Ir sensor trouble

i am having trouble with my project of trying to control my rgb led with my ir sensor with remote. If I put the code on to the Arduino and go to the serial plotter all i get back when i push a button is a bunch of zeros

</#include <IRremote.h>

const int B_led = 8;
const int G_led = 9;
const int R_led = 10;
const int Recv_pin = 11;

IRrecv IRrecv(Recv_pin);
decode_results results;

int result;

void setup() {
  pinMode(B_led, OUTPUT);
  pinMode(G_led, OUTPUT);
  pinMode(R_led, OUTPUT);

  Serial.begin(9600);

  IRrecv.enableIRIn();

  IrReceiver.begin(Recv_pin, ENABLE_LED_FEEDBACK);
}

bool isblueon = false;
bool isgreenon = false;
bool isredon = false;

void loop () {

  {
    if (IRrecv.decode())
    {
      Serial.println(results.value, HEX);
      IRrecv.resume(); // Receive the next value
    }
  }

  if (IrReceiver.decode())

    if (result == 0xFF6897) {
      if (isblueon == true) {
        digitalWrite(B_led, LOW);
        isblueon == false;
      } else {
        digitalWrite(B_led, HIGH);
        isblueon = true;
      }

      IrReceiver.resume();
    }
}/>

thats the codePreformatted text

Since what you posted doesn't even compile./verify then you cannot have uploaded or tested it. So where is the real code?

Problems include IRrecv vs IrReceiver and 'result' which cannot possibly equal 0xFF6897 since that's way too big to fit in an integer.

Steve

Please follow the advice given in the link below when posting code . Use code tags when posting code here to make it easier to read and copy for examination

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.