Go Down

Topic: IR sensor (Read 402 times) previous topic - next topic

kiva

Hi,

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?

Thanks 

Bet

Sketch:

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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy