Pages: [1]   Go Down
Author Topic: Problem with IR Sensor  (Read 43 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, i have a problem with a IR Sensor (vs1838), i used the library IRremote and changed "WsProgram" to "Arduino.h". But I can't get it to work, i conect the right pin of the sensor at voltage (5v), middel pin at ground and left pin at Arduino Digital Pin number 0.
I tested with public codes but i can't get it work.

Sorry with my english and hope you can help me.

Regards smiley
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46266
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
and left pin at Arduino Digital Pin number 0.
Why are you connecting the device to the hardware serial pin? How do you then KNOW it doesn't work? Where IS your code that you were supposed to have posted?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did not say that the code does not work, I said that i don't get it to work. i used this code:

Code:
#include <IRremote.h>

int RECV_PIN = 10;

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
  }
}

and Connection by guiding this image:



Thanks for responding so quickly.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46266
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i conect the right pin of the sensor at voltage (5v), middel pin at ground and left pin at Arduino Digital Pin number 0.
So, this statement is nonsense? It does not agree with the picture.

Code:
int RECV_PIN = 10;
The picture says that the receiver is connected to pin 2.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I know, i changed the reciver pin in my code, but Why does not agree with the image?. The only difference is the reciver pin.
Logged

Pages: [1]   Go Up
Jump to: