#include// serial library int bp = 3;// declare that bp(pushbutton)is in pin 3 const int LED = 7; SoftwareSerial myserial(0, 1); // define the serial and the TX=1 and RX=0 void setup() { pinMode(bp,INPUT_PULLUP) ;// Declare that pushbutton is an input pinMode(LED,OUTPUT); // establecer que el pin digital es una seƱal de salida myserial.begin(9600); } void loop() { int bps = 0; bps = digitalRead(bp); if (bps == LOW) //if the pushbutton is pressed this condition will be true { myserial.write('a');// send this char digitalWrite(LED, HIGH); // enciende el LED myserial.print("Encendido"); } else { myserial.write('0');//if the pushbutton is not pressed sen this char digitalWrite(LED,LOW); // apagar el LED } delay(100); }