Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #include <IRremote.h>
- //Strip Light Objects
- #define NUM_LEDS 240 // How many LEDs we're lighting
- CRGB leds[NUM_LEDS]; // Declare Strip Array
- #define PIN 6 // Pin that controls strip
- byte hue; // Use to hold colors
- //IR Remote Objects
- int receiver = 3; // Pin that listens for IR
- IRrecv irrecv(receiver); // Declare IR Object
- decode_results results; // Holds IR Result Codes
- /* IR Receive Codes
- 0xFFA25D: POWER
- 0xFFE21D: FUNC/STOP
- 0xFF629D: VOL+
- 0xFF22DD: FAST BACK"
- 0xFF02FD: PAUSE
- 0xFFC23D: FAST FORWARD
- 0xFFE01F: DOWN
- 0xFFA857: VOL-
- 0xFF906F: UP
- 0xFF9867: EQ
- 0xFFB04F: ST/REPT
- 0xFF6897: 0
- 0xFF30CF: 1
- 0xFF18E7: 2
- 0xFF7A85: 3
- 0xFF10EF: 4
- 0xFF38C7: 5
- 0xFF5AA5: 6
- 0xFF42BD: 7
- 0xFF4AB5: 8
- 0xFF52AD: 9
- 0xFFFFFFFF: Repeat
- */
- void setup()
- {
- //Setup LED Strip
- FastLED.addLeds<NEOPIXEL, PIN>(leds, NUM_LEDS);
- FastLED.setBrightness(255);
- FastLED.clear();
- //Setup IR Receiver
- irrecv.enableIRIn();
- Serial.begin(115200);
- }
- void loop() {
- if (irrecv.decode(&results)) {
- irrecv.resume();
- Serial.println(results.value);
- }
- delay(50);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement