Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hi,
I am new to the mbed platform. After i recived my kit i have tried a lot of the examples in the cookbook.
Now i wanted to use my pololu Servo Controler on the mbed. Unfortunatly i have an error in my Programm and the servo does not move a bit.
pololu_class
I think my error is in the Command sequence.
void pololu_mssc::move(int p_servo, int p_angle) { char pos_hi,pos_low; int temp; //Convert the angle data into two 7-bit bytes temp = p_angle & 0x1f80; pos_hi = temp >> 7; pos_low= p_angle & 0x7f; //Construct and send a Pololu Protocol command sentence _mssc -> putc(0x80); //start byte _mssc -> putc(0x01); //device id _mssc -> putc(0x04); //command number _mssc -> putc((char) p_servo); //servo number _mssc -> putc(pos_hi); //angle data1 _mssc -> putc(pos_low); //angle data2 }Thank you for your help