chiark / gitweb /
Big update here.
[wiringPi.git] / examples / servo.c
1
2 #include <stdio.h>
3 #include <errno.h>
4 #include <string.h>
5
6 #include <wiringPi.h>
7 #include <softServo.h>
8
9 int main ()
10 {
11   if (wiringPiSetup () == -1)
12   {
13     fprintf (stdout, "oops: %s\n", strerror (errno)) ;
14     return 1 ;
15   }
16
17   softServoSetup (0, 1, 2, 3, 4, 5, 6, 7) ;
18
19   softServoWrite (0,  0) ;
20 /*
21   softServoWrite (1, 1000) ;
22   softServoWrite (2, 1100) ;
23   softServoWrite (3, 1200) ;
24   softServoWrite (4, 1300) ;
25   softServoWrite (5, 1400) ;
26   softServoWrite (6, 1500) ;
27   softServoWrite (7, 2200) ;
28 */
29
30   for (;;)
31     delay (10) ;
32
33 }