Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // IR code deformer
- // /SAJAT IR VEVO lent/
- // ___
- //|( )| PIN 1 = GND
- //|___| PIN 2 = 3V3
- //| | | PIN 3 = SIGNAL TO ARDUINO PWM PIN 11
- //| | |
- //1 2 3
- #include <IRremote.h>
- int RECV_PIN = 11;
- IRsend irsend;
- IRrecv irrecv(RECV_PIN);
- decode_results results;
- int ledPin = 3; // LED pin
- int flashPin = 13; // Switch pin
- void setup()
- {
- Serial.begin(9600);
- pinMode(ledPin, OUTPUT);
- pinMode(flashPin, OUTPUT);
- Serial.println("Minden OK, johet a kod!");
- irrecv.enableIRIn(); // Start the receiver
- }
- void loop()
- {
- if (irrecv.decode(&results)) {
- switch (results.value) {
- case 0xFF6897:
- Serial.print("0 - led be");
- digitalWrite(flashPin, HIGH);
- break;
- case 0xFF30CF:
- Serial.print("1 - led ki");
- digitalWrite(flashPin, LOW);
- break;
- case 0xFF18E7:
- Serial.print("2 - led be es POWER signal");
- digitalWrite(flashPin, HIGH);
- irsend.sendNEC(0x5EA1F807, 32);
- break;
- case 0xFF7A85:
- Serial.println("gomb 3");
- break;
- }
- irrecv.resume(); // Receive the next value
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement