Arduino IR Remort Controlled Switch
2 Channel AC Switch Useing IR Remort Control
urce code
#include <IRremote.h>
?
int RECV_PIN = 11;?
?
String IRButton1 = "1FE50AF";//SWITCH 1?
?
String IRButton2 = "2D607981";//SWITCH 2?
?
?
?
const int ledPin1 = 4;// Relay 1?
?
const int ledPin2 = 5;// Relay 2?
?
?
?
?
IRrecv irrecv(RECV_PIN);?
?
?
decode_results results;?
?
String BUTTONPRESSED;?
?
int button1 = 0;?
?
int button2 = 0;?
?
?
?
void setup()?
?
{?
?
Serial.begin(9600);?
?
irrecv.enableIRIn(); // Start the receiver?
?
pinMode(ledPin1, OUTPUT);?
?
pinMode(ledPin2, OUTPUT);?
?
?
?
}?
?
?
void loop() {?
?
if (irrecv.decode(&results)) {?
?
Serial.println(results.value, HEX);?
?
BUTTONPRESSED = String(results.value, HEX);?
?
BUTTONPRESSED.toUpperCase();?
?
Serial.print("BUTTONPRESSED ");?
?
Serial.println(BUTTONPRESSED);?
?
//delay(1000);?
?
?
//button 1?
?
if (BUTTONPRESSED == IRButton1) ?
{?
?
if (button1 == 0) ?
{?
?
button1 = 1;?
?
}?
?
else?
?
button1 = 0;?
?
if (button1 == 1) ?
{?
?
digitalWrite(ledPin1, HIGH);?
?
?
?
?
?
?
}?
?
else?
?
digitalWrite(ledPin1, LOW);?
?
}?
?
?
//button 2?
?
if (BUTTONPRESSED == IRButton2) {?
?
if (button2 == 0) {?
?
button2 = 1;?
?
}?
?
else?
?
button2 = 0;?
?
if (button2 == 1) {?
?
digitalWrite(ledPin2, HIGH);?
?
?
?
}?
?
else?
?
digitalWrite(ledPin2, LOW);?
?
} ?
irrecv.resume(); // Receive the next value?
}?
}?
Arduino IR Remort Controlled Switch

Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW
ESP32-S3 4.3inch Capacitive Touch Display Development Board, 800×480, 5-point Touch, 32-bit LX7 Dual-core Processor
BUY NOW
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(0)

- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by sreeraj Sreeraj Krishna
-
-
-
Modifying a Hotplate to a Reflow Solder Station
744 1 5 -
MPL3115A2 Barometric Pressure, Altitude, and Temperature Sensor
400 0 1 -
-
Nintendo 64DD Replacement Shell
350 0 2 -
V2 Commodore AMIGA USB-C Power Sink Delivery High Efficiency Supply Triple Output 5V ±12V OLED display ATARI compatible shark 100W
961 4 2 -
How to measure weight with Load Cell and HX711
636 0 3