int sisend = 0; void setup() { Serial.begin(9600); pinMode(13, OUTPUT); } void loop() { if (Serial.available() > 0) { sisend = Serial.read(); if(sisend==97){ digitalWrite(13, HIGH); } if(sisend==98){ digitalWrite(13, LOW); } } } /* >>> import serial >>> ser=serial.Serial("COM4") >>> ser.write(b'a') 1 >>> ser.write(b'b') 1 >>> ser.close() */