I have a question about infrared remote control, I was adding to my project a remote control, I reach to decode every button I've found In it but it doesn't work properly.
I only want to change relays status from High to Low with two buttons.
When I try it I've push the buttons but nothing happens.
Here you can see the code below. What should I change in it?
Posting pictures of code is discouraged. Please consider editing your post and posting the code in code tags.
1 Like
xfpd
January 8, 2024, 4:52am
3
edwinjbg:
see the code below
That is not your complete sketch. To fix this, using your IDE:
open the sketch
CTRL-A to "select all" of your sketch
open a forum reply to your responses
click the < CODE > icon in the edit window
paste your code where the edit window say, "... '''type or paste your code here'''
Your code should look something like this...
void setup() {
// YOU ARE MISSING CONFIGURING THE IRREMOTE DEVICES IN SETUP
}
void loop() {
digitalWrite (2, LOW);
digitalWrite (3, LOW);
if (irrecv.decode(&results))
{
on = !on;
digitalWrite (13, on ? HIGH LOW);
irrecv.resume ();
Serial.println("RECIBIENDO");
Serial.print (results.value);
Serial.print (F("-> "));
switch (results.value) {
case 0xFFA25D:
Serial.println (F("POWER")); break;
digitalWrite (2, HIGH);
digitalWrite(3, HIGH); // <-- WHERE IS THE 'break;'??
case 0xFF629D:
Serial.println (F("VOL+")); break;
case 0xFFE21D:
Serial.println (F("FUNC/STOP")); break;
case 0xFF22DD:
Serial.println (F("FAST BACK")); break;
case 0xFF02FD:
Serial.println (F("PLAY/PAUSE")); break;
case 0xFFC23D:
Serial.println (F("FAST FORWARD")); break;
case 0xFF38
Serial.println (F("5")); break;
case 0xFF5AA5:
Serial.println(F("6")); break;
case 0xFF42BD:
Serial.println (F("7")); break;
case 0xFF4AB5:
Serial.println (F("8")); break;
case 0xFF52AD:
Serial.println (F("9")); break;
irrecv.resume ();
}
delay(300);
}
}
1 Like
This looks very similar to his previous question posted the same way.
system
Closed
July 6, 2024, 5:13am
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.