int x = 0;void setup(){ Serial.begin(9600); delay(500);}void loop(){ if (Serial.available() > 0) { x = Serial.read(); Serial.print("MCU is received: "); Serial.println(x); }}
#define LED D0int x = 0;void setup(){ pinMode(LED,OUTPUT); digitalWrite(LED,LOW); Serial.begin(9600); delay(500);}void loop(){ if (Serial.available() > 0) { x = Serial.read(); Serial.print("MCU is received: "); Serial.println(x); if(x=='a') { digitalWrite(LED,HIGH); } else { digitalWrite(LED,LOW); } }}