IR recieve and print to serial monitor code:

#include <IRremote.h>
 
int RECV_PIN = 11;
 
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);//prints decimal IR code
    irrecv.resume(); // Receive the next value
  }
  delay(100);
}
 
 
Code to controll relays and EL Wire:
 
int Flash1 = 7;                   // Pin 7 used 
int Flash2 = 6;                   // Pin 6 used
 
void setup()  
  pinMode(Flash1, OUTPUT);        // declare pin 7 to be an output
  pinMode(Flash2, OUTPUT);        // declare pin 6 to be an output
 
void loop()  
  digitalWrite(Flash1,HIGH);      // NO1 and COM1 Connected 
  digitalWrite(Flash2,LOW);       // NO2 and COM2 Disconnected
  delay(250);                     // wait 1000 milliseconds 
  digitalWrite(Flash1,LOW);       // NO1 and COM1 Disconnected 
  digitalWrite(Flash2,HIGH);      // NO2 and COM2 Connected
  delay(250);                     // wait 1000 milliseconds                      
}

both programms work perfectly on their own but when i try to use the IR remote to turn the lights on when the power button is pressed nothing happens the lights always stay on no matter what is pressed and not pressed

Brett Novak

9 years ago

Power-31377463
 
 
Eject-31355533
 
 
Rewind-31365223
 
 
FastFoward-31332583
 
 
Play-31352983
 
 
Stop-31385623
 
 
Still-31348903
 
Repeat-31361143
 
 
Auto-31345333
 
 
TrackingUp-31375933
 
 
TrackingDown-31335133