You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
599 B

int recv = 0;
// 0 FORWARD
// 1 BACKWARD
// 2 LEFT
// 3 RIGHT
void setup() {
Serial.begin(115200); //initial the Serial
}
void loop() {
if (Serial.available()) {
switch (Serial.read())
{
case 0:
Serial.println("MOVING FORWARD");
break;
case 1:
Serial.println("MOVING BACKWARD");
break;
case 2:
Serial.println("MOVING LEFT");
break;
case 3:
Serial.println("MOVING RIGHT");
break;
default:
Serial.println("INVALID INSTRUCTION");
}
}
}