Guest User

Untitled

a guest
Feb 21st, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <DmxReceiver.h>
  2. #include <FastLED.h>
  3. #include <TimerOne.h>
  4.  
  5. DmxReceiver dmx;
  6. IntervalTimer dmxTimer;
  7.  
  8. void pdmx()
  9. {
  10.     print_dmx_buffer();
  11. }
  12.  
  13. void dmxTimerISR(void)
  14. {
  15.     dmx.bufferService();
  16. }
  17.  
  18. void setup()
  19. {
  20.     /* USB serial */
  21.     Serial.begin(115200);
  22.  
  23.     /* DMX */
  24.     Timer1.initialize(10000000);
  25.     Timer1.attachInterrupt(pdmx);
  26.     dmx.begin();
  27.  
  28.     /* Use a timer to service DMX buffers every 1ms */
  29.     dmxTimer.begin(dmxTimerISR, 1000);
  30.     LEDS.setBrightness(max_bright);
  31.  
  32.     //LEDS.addLeds<LPD8806, BRG>(leds, LED_COUNT);
  33.     LEDS.addLeds<WS2812B, 18, GRB>(leds, LED_COUNT);
  34.     one_color_all(0, 0, 0);
  35.     LEDS.show();
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment