Page 146 - MDP2022-3
P. 146
swR_State = digitalRead(swR);
swL_State = digitalRead(swL);
swA1_State = digitalRead(swA1);
swA2_State = digitalRead(swA2);
swA3_State = digitalRead(swA3);
swA4_State = digitalRead(swA4);
swA5_State = digitalRead(swA5);
if(swG_State != swG_PreState && swG_State){
Serial.println("SwG Pressed!!");
HC06.write("G");
}
else if(swB_State != swB_PreState && swB_State){
Serial.println("SwB Pressed!!");
HC06.write("B");
}
else if(swR_State != swR_PreState && swR_State){
Serial.println("SwR Pressed!!");
HC06.write("L");
}
else if(swL_State != swL_PreState && swL_State){
Serial.println("SwL Pressed!!");
HC06.write("R");
}
else if(swA1_State != swA1_PreState && swA1_State){
Serial.println("SwA1 Pressed!!");
HC06.write("O");
}
else if(swA2_State != swA2_PreState && swA2_State){
Serial.println("SwA2 Pressed!!");
HC06.write("T");
}
else if(swA3_State != swA3_PreState && swA3_State){
Serial.println("SwA3 Pressed!!");
HC06.write("Y");
}
else if(swA4_State != swA4_PreState && swA4_State){
Serial.println("SwA4 Pressed!!");
HC06.write("J");
}
else if(swA5_State != swA5_PreState && swA5_State){