Hi guys
As I mentioned in title, I'm trying to control relay with my arduino yun(and my own webpage.)
I'm just getting everything right but my relay won't work right. :o :o
I wrote the code bellow which I'm having trouble with.
HttpClient client_2;
client_2.get(Help);
int c = client_2.read();
int k = c-48;
if (client_2.available()){
Serial.println(c);
Serial.println(k);
if(k==1){
Serial.println("ON");
digitalWrite(Relay,HIGH);
}
else{
Serial.println("OFF");
digitalWrite(Relay,HIGH);
}
I first wrote the code with "char c" instead of "int c" but it did not work.
So I changed them into "int" type. In the Serial moniter, I'm getting
49
1
ON
which means the code is working great! However, my relay won't turn on....
It would be great to know the problem. Please help me!