Remote Control Light Switch cover (Flat Switch) V1
Print Profile(1)

Bill of Materials
Description
If you like my work and enjoy my models please consider Boosting
Arduino Micro, Ir Remote. Replace the Hex Values in the code with your own ir remote button codes.
CODE:
#include <IRremote.hpp>
#include <Servo.h>
#define IR_RECEIVE_PIN 2
Servo myServo;
void setup() {
Serial.begin(9600);
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
myServo.attach(9); // Servo on pin 9
}
void loop() {
if (IrReceiver.decode()) {
unsigned long code = IrReceiver.decodedIRData.decodedRawData;
Serial.println(code, HEX);
if (code == 0xE916FF00) {
myServo.write(30);
}
else if (code == 0xF30CFF00) {
myServo.write(120);
}
IrReceiver.resume();
}
}
If you want the behind the scenes of any of my existing/upcoming models please check out my Linktree.
If you would like to kindly leave a donation, you may do so here.






















Comment & Rating (3)