Hello friends, I am new to arduino and C. I am finding it difficult to select address lines and data lines for HT12E(Encoder IC).
Right now I am using a Raspberry Pi to select address lines for HT12E with a DIP switch and every time I must physically change the address to communicate to the decoder(s).
I am trying to use digitalWrite and digitalRead in switch case and loops from the given examples and references from this site and also did some searching and the result could not help me. Can you guys help me out?
Current code that I am working on, doesn't seem to work. If you guys can clear the bug in this code I can code for HT12E.
int a= 2;
int b = 1;
int c = 6;
int d = 5;
void setup(){
pinMode(a, INPUT);
pinMode(b, INPUT);
pinMode(c, OUTPUT);
pinMode(d,OUTPUT);
}
void loop(){
int state = HIGH;
int one = digitalRead(a==HIGH);
int two = digitalRead(b==HIGH);
switch(state){
case 'one':
digitalWrite(c,HIGH);
break;
case 'two':
digitalWrite(d,HIGH);
break;
}
}