// ARDUINO YUKLE
#include <SoftwareSerial.h>
SoftwareSerial ArduinoUno (10, 11);
int a, b, c, d;
void setup() {
Serial.begin(9600);
ArduinoUno.begin(4800);
pinMode( 4, OUTPUT);
digitalWrite(4, HIGH);
pinMode(12, OUTPUT);
digitalWrite(12, HIGH);
pinMode( 5, OUTPUT);
digitalWrite(5, HIGH);
pinMode( 9, OUTPUT);
digitalWrite(9, HIGH);
}
void loop() {
while (ArduinoUno.available() > 0) {
int val = ArduinoUno.parseInt();
if (ArduinoUno.read() == '\n') {
Serial.println(val);
if (val == a); {
if (val == LOW) {
digitalWrite(4, LOW);
}
else {
digitalWrite(4, HIGH);
}
}
}
}
while (ArduinoUno.available() > 0) {
int vbl = ArduinoUno.parseInt();
if (ArduinoUno.read() == '\n') {
Serial.println(vbl);
if (vbl == b); {
if (vbl == LOW) {
digitalWrite(12, LOW);
}
else {
digitalWrite(12, HIGH);
}
}
}
}
while (ArduinoUno.available() > 0) {
int vcl = ArduinoUno.parseInt();
if (ArduinoUno.read() == '\n') {
Serial.println(vcl);
if (vcl == c); {
if (vcl == LOW) {
digitalWrite(5, LOW);
}
else {
digitalWrite(5, HIGH);
}
}
}
}
while (ArduinoUno.available() > 0) {
int vdl = ArduinoUno.parseInt();
if (ArduinoUno.read() == '\n') {
Serial.println(vdl);
if (vdl == d); {
if (vdl == LOW) {
digitalWrite(9, LOW);
}
else {
digitalWrite(9, HIGH);
}
}
}
}
delay (300);
}