int pinted=2; int dato=0; pinMode (pinted,OUTPUT) Serial.begin(9600); void setup() { // } void loop() { if(Serial.available()>;} if(dato=Serial.read();} if(dato== '1') {digitalWrite(pinLed,HIGH);} else if (dato=='0') {digitalWrite(pinLed,LOW);} }