Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* This example tests both FastLED and the IRRemote.
- By: Andrew Tuline
- Date: Oct 30, 2014
- As of the current 3.1 FastLED library, both FastLED.show() and FastLED.delay() must be commented out in order for the IR to work properly.
- */
- #include "FastLED.h"
- #include "IRremote.h"
- int RECV_PIN = 9;
- IRrecv irrecv(RECV_PIN);
- decode_results results;
- #define LED_DT 12
- #define COLOR_ORDER GRB
- #define LED_TYPE WS2812B
- #define NUM_LEDS 100
- struct CRGB leds[NUM_LEDS];
- void setup() {
- Serial.begin(57600);
- irrecv.enableIRIn(); // Start the receiver
- LEDS.addLeds<LED_TYPE, LED_DT, COLOR_ORDER >(leds, NUM_LEDS);
- }
- void loop() {
- // FastLED.show();
- // FastLED.delay(5);
- if (irrecv.decode(&results)) {
- Serial.println(results.value, HEX); // Print IR receive results
- irrecv.resume(); // Receive the next value
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment