Thanks for the reply. I tried adding a full 5 second delay before the command is sent, the response is now "ÿ±?ö" which is different than the “H???åÿ”, but still not "Hello". I must be overlooking something simple.
Please help ![]()
Here is the code:
#include <Servo.h>
Servo servo1; Servo servo2;
void setup() {
pinMode(1,OUTPUT);
servo1.attach(14);
servo1.setMaximumPulse(2200);
servo2.attach(15);
Serial.begin(19200);
delay(5000);
Serial.print("Ready");
}
void loop() {
static int v = 0;
if ( Serial.available()) {
char ch = Serial.read();
switch(ch) {
case '0'...'9':
v = v * 10 + ch - '0';
break;
case 's':
servo1.write(v);
v = 0;
break;
case 'w':
servo2.write(v);
v = 0;
break;
case 'd':
servo2.detach();
break;
case 'a':
servo2.attach(15);
break;
}
}
Servo::refresh();
}