Hello,
I can't seem to have newsoftserial print the correct byte to a pololu micro maestro 6 channel.
I have this function:
void setServoTarget(int servo, int pos){
byte byteCommand[3];
byteCommand[0] = 0xff;
byteCommand[1] = (servo & 0x7F);
byteCommand[2] = (pos & 0x7F);
for (int i = 0; i < 3; i++) controller.print(byteCommand[i]);
}
These calls to that function all work except the last one (sending a value of 254):
setServoTarget(1,1);
delay((500));
setServoTarget(1,127);
delay(500);
setServoTarget(1,254); // also tried 200, 250
Also note that this code works:
controller.print(0xff, BYTE);
controller.print(0x01, BYTE);
controller.print(0xfe, BYTE);
I'm still new to Arduino so I might be missing something, anyone have any ideas?