Pages: [1]   Go Down
Author Topic: IR sensor  (Read 360 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


I work in a project with a IR sensor.
When I try samples sketches, the received codes display in the monitor output but in the upper box, beside the send buttom. Why?

I've write some messages in the sketch to see if it works. Never appears "Step One".

Could you help me?




#include <IRremote.h> // use the library
int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results;
void setup()
  Serial.begin(9600); // for serial monitor output
  irrecv.enableIRIn(); // Start the receiver
void loop()
  if (irrecv.decode(&results)) // have we received an IR signal?
    Serial.println("Step One");  //test message
    Serial.println(results.value, HEX); // display it on serial monitor in hexadecimal
    irrecv.resume(); // receive the next value
  }  // Your loop can do other things while waiting for an IR command

Pages: [1]   Go Up
Jump to: