#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
Serial.begin(115200);
lcd.begin(16, 2);
pinMode(ROLE1, OUTPUT);
pinMode(ROLE2, OUTPUT);
pinMode(ROLE3, OUTPUT);
pinMode(ROLE4, OUTPUT);
Serial.println("Komut giriniz:");
}
void loop() {
if(Serial.available() > 0) {
int inByte = Serial.read();
switch (inByte) {
case '1':
digitalWrite(ROLE1, HIGH);
digitalWrite(ROLE2, LOW);
digitalWrite(ROLE3, LOW);
digitalWrite(ROLE4, LOW);
lcd.setCursor(0, 1);
lcd.print("SAGO DON");
break;
case '2':
digitalWrite(ROLE1, LOW);
digitalWrite(ROLE2, HIGH);
digitalWrite(ROLE3, LOW);
digitalWrite(ROLE4, LOW);
lcd.setCursor(0, 1);
lcd.print("SOLA DON");
break;
case '3':
digitalWrite(ROLE1, LOW);
digitalWrite(ROLE2, LOW);
digitalWrite(ROLE3, HIGH);
digitalWrite(ROLE4, LOW);
lcd.setCursor(0, 1);
lcd.print("ONE DON");
break;
case '4':
digitalWrite(ROLE1, LOW);
digitalWrite(ROLE2, LOW);
digitalWrite(ROLE3, LOW);
digitalWrite(ROLE4, HIGH);
lcd.setCursor(0, 1);
lcd.print("ARKAYA DON");
break;
default:
Serial.println("Komut anlaşılmadı..!);
break;
}
}
}