int CHA = 2; int CHB = 3; int ENA = 4; char ASCII_cmd; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(CHA,OUTPUT); pinMode(CHB,OUTPUT); pinMode(ENA,OUTPUT); } void loop() { while (Serial.available() < 1) { } ASCII_cmd=Serial.read(); // If the ASCII command is 65 ('a') then do a memory dump to the PC if (ASCII_cmd == 'C') { digitalWrite(CHA,HIGH); digitalWrite(CHB,LOW); digitalWrite(ENA,HIGH); } // If the ASCII command is 65 ('a') then do a memory dump to the PC if (ASCII_cmd == 'D') { digitalWrite(CHA,LOW); digitalWrite(CHB,HIGH); digitalWrite(ENA,HIGH); } }