#include <RCSwitch.h>
int counter = 0;
int vericikodu;
unsigned long int num;
RCSwitch mySwitch = RCSwitch();
void setup()
{
Serial.begin(9600);
mySwitch.enableReceive(0);
}
SdPlay.setSDCSPin(4);
pinMode(2, INPUT);
pinMode(A0, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A3, OUTPUT);
pinMode(A4, OUTPUT);
pinMode(A5, OUTPUT);
pinMode(5, OUTPUT);
digitalWrite(A0,LOW); //B
digitalWrite(A1,LOW); //A
digitalWrite(A2,LOW); //C
digitalWrite(A3,LOW); //E
digitalWrite(A4,LOW); //F
digitalWrite(A5,LOW); //G
digitalWrite(5,LOW); //D
}
void loop()
{
mySwitch.disableReceive();
mySwitch.enableReceive(0);
if (mySwitch.available())
{
num = mySwitch.getReceivedValue();
Serial.println("vericikodu;" + String(num));
switch (num)
{
// BİR
case 2718372: //L1
digitalWrite(A0,HIGH);
digitalWrite(A1,LOW);
digitalWrite(A3,LOW);
digitalWrite(A2,HIGH);
digitalWrite(5,LOW);
digitalWrite(A4,LOW);
digitalWrite(A5,LOW);
delay(6000);
digitalWrite(A0,LOW); //B
digitalWrite(A1,LOW); //A
digitalWrite(A2,LOW); //C
digitalWrite(A3,LOW); //E
digitalWrite(A4,LOW); //F
digitalWrite(A5,LOW); //G
digitalWrite(5,LOW); //D
break;
// İKİ
case 2325156: //L2
digitalWrite(A0,HIGH);
digitalWrite(A1,HIGH);
digitalWrite(A3,HIGH);
digitalWrite(A2,LOW);
digitalWrite(5,HIGH);
digitalWrite(A4,LOW);
digitalWrite(A5,HIGH);
delay(6000);
digitalWrite(A0,LOW); //B
digitalWrite(A1,LOW); //A
digitalWrite(A2,LOW); //C
digitalWrite(A3,LOW); //E
digitalWrite(A4,LOW); //F
digitalWrite(A5,LOW); //G
digitalWrite(5,LOW); //D
break;
// ÜÇ
case 3555684: //L3
digitalWrite(A0,HIGH); //B
digitalWrite(A1,HIGH); //A
digitalWrite(A2,HIGH); //C
digitalWrite(A3,LOW); //E
digitalWrite(A4,LOW); //F
digitalWrite(A5,HIGH); //G
digitalWrite(5,HIGH); //D
delay(6000);
digitalWrite(A0,LOW); //B
digitalWrite(A1,LOW); //A
digitalWrite(A2,LOW); //C
digitalWrite(A3,LOW); //E
digitalWrite(A4,LOW); //F
digitalWrite(A5,LOW); //G
digitalWrite(5,LOW); //D
break;
default:
break;
}
mySwitch.resetAvailable();
mySwitch.enableReceive(0);
}
}