//LED button code, turns on the led once the button is toggeled // Murad Saadeh // 22/4/2017 #include SoftwareSerial mySerial(9, 7); // RX, TX #include // initialize the library by associating any needed LCD interface pin // with the arduino pin number it is connected to const int rs = 10, en = 8, d4 = 3, d5 = 2, d6 = 1, d7 = 0; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); char serialData; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. mySerial.begin(4800); lcd.begin(16, 2); } // the loop routine runs over and over again forever: void loop() { if (mySerial.available()) { serialData = mySerial.read(); mySerial.print(serialData); if (serialData == 'a') { lcd.print("A"); // turn the LED on (HIGH is the voltage level) } if (serialData == 'b' ) { lcd.print("B"); // turn the LED off by making the voltage LOW } if (serialData == 'c') { lcd.print("C"); // turn the LED on (HIGH is the voltage level) } if (serialData == 'd' ) { lcd.print("D"); // turn the LED off by making the voltage LOW } } }