Torsten Dillenburg
/
pololu_class
Class to use a Pololu Micro Serial Servo Controler
Diff: main.cpp
- Revision:
- 1:5d0bc0302099
- Parent:
- 0:e0c4e4123bdc
--- a/main.cpp Wed Nov 03 10:59:41 2010 +0000 +++ b/main.cpp Wed Nov 03 13:08:37 2010 +0000 @@ -11,7 +11,7 @@ class pololu_mssc { public: pololu_mssc(PinName ptx, PinName prx, PinName rst); // Constructor - void move(int p_servo, int p_angle); // Move Servo(0..7) to Angle (value between 0 and 5500) + void move(char p_servo, char p_angle); // Move Servo(0..7) to Angle (value between 0 and 5500) void reset(void); // Reset Controler private: @@ -27,7 +27,7 @@ reset(); } -void pololu_mssc::move(int p_servo, int p_angle) +void pololu_mssc::move(char p_servo, char p_angle) { char pos_hi,pos_low; int temp; @@ -64,11 +64,11 @@ //---- Main ---------------------------------------------------------------------- int main() { myled = 1; - servo_control.move(0,1000); + servo_control.move(1,1000); wait(1); - servo_control.move(0,4000); + servo_control.move(1,4000); wait(1); - servo_control.move(0,1000); + servo_control.move(1,1000); wait(1); myled2 = 1; }