servom
Dependents: servomotore progetto8 progetto9 progetto10 ... more
SG90.h@0:a62b163b1dbb, 2014-04-05 (annotated)
- Committer:
- iLyngklip
- Date:
- Sat Apr 05 07:56:43 2014 +0000
- Revision:
- 0:a62b163b1dbb
dillerdasker
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
iLyngklip | 0:a62b163b1dbb | 1 | #ifndef SG90_H |
iLyngklip | 0:a62b163b1dbb | 2 | #define SG90_H |
iLyngklip | 0:a62b163b1dbb | 3 | #include "mbed.h" |
iLyngklip | 0:a62b163b1dbb | 4 | #include "PwmOut.h" |
iLyngklip | 0:a62b163b1dbb | 5 | |
iLyngklip | 0:a62b163b1dbb | 6 | class servo { |
iLyngklip | 0:a62b163b1dbb | 7 | |
iLyngklip | 0:a62b163b1dbb | 8 | public: |
iLyngklip | 0:a62b163b1dbb | 9 | |
iLyngklip | 0:a62b163b1dbb | 10 | PwmOut pwm1, pwm2, pwm3, pwm4; |
iLyngklip | 0:a62b163b1dbb | 11 | servo(); |
iLyngklip | 0:a62b163b1dbb | 12 | |
iLyngklip | 0:a62b163b1dbb | 13 | |
iLyngklip | 0:a62b163b1dbb | 14 | void init(); |
iLyngklip | 0:a62b163b1dbb | 15 | void right(int); |
iLyngklip | 0:a62b163b1dbb | 16 | void left(int); |
iLyngklip | 0:a62b163b1dbb | 17 | void position(int, int); |
iLyngklip | 0:a62b163b1dbb | 18 | |
iLyngklip | 0:a62b163b1dbb | 19 | int s1, s2, s3, s4; |
iLyngklip | 0:a62b163b1dbb | 20 | |
iLyngklip | 0:a62b163b1dbb | 21 | |
iLyngklip | 0:a62b163b1dbb | 22 | |
iLyngklip | 0:a62b163b1dbb | 23 | }; |
iLyngklip | 0:a62b163b1dbb | 24 | #endif |