Go Down

Topic: IR receiver HEX value 0 (Read 422 times) previous topic - next topic

elbaloo

Hello!

I got an IR receiver with an IR remote control but when I tried to connect them to Arduino UNO and read the HEX value in serial monitor it returns value 0.
The code is :
Quote
#include <IRremote.h>
int RECV_PIN = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop(){
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value }
}
Where is the problem?
IR receiver connections: 
Quote
IR RECEIVER  | ARDUINO 
      1(OUT)                  PIN7
      2(GND)                  GND on breadboard(connected with                                         arduino GND)
      3(VCC)                 5V on breadoboard(connected to                                               arduino 5V) 
Quote
IR receiver photo + pins
https://images.app.goo.gl/5LXWx43ZBaXEXxPo9
When I press any button on remote it returns 0.
Where should be the problem? It's broken? 


larryd

#1
Jan 22, 2021, 09:29 pm Last Edit: Jan 22, 2021, 09:36 pm by larryd
Let's see your wiring.

Make sure your "Serial Monitor" is set to 9600 baud ;).



No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

6v6gt

This seems similar to this issue:
https://forum.arduino.cc/index.php?topic=724088

I'm beginning to suspect a library error due to a recent change. Did you load or update your copy of the IR library recently?

Go Up