bangnaga

Wemos Esp8266 MQTT INA219 LDR

Jul 25th, 2021 (edited)
47
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. #include <Adafruit_NeoPixel.h>
  4. #ifdef __AVR__
  5. #include <avr/power.h> // Required for 16 MHz Adafruit Trinket
  6. #endif
  7. int PIN   =   LED_BUILTIN;
  8. #define NUMPIXELS 10
  9.  
  10.  
  11. Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
  12.  
  13. #define DELAYVAL 500 // Time (in milliseconds) to pause between pixels
  14.  
  15. void setup() {
  16. pixels.begin();
  17. }
  18.  
  19. void loop() {
  20. pixels.clear();
  21. pixels.setBrightness(0);
  22. pixels.setPixelColor(0, pixels.Color(255, 255, 255));
  23. pixels.setPixelColor(1, pixels.Color(255, 255, 255));
  24. pixels.setPixelColor(2, pixels.Color(255, 255, 255));
  25. pixels.setPixelColor(3, pixels.Color(255, 255, 255));
  26. pixels.setPixelColor(4, pixels.Color(255, 255, 255));
  27. pixels.setPixelColor(5, pixels.Color(255, 255, 255));
  28. pixels.setPixelColor(6, pixels.Color(255, 255, 255));
  29. pixels.setPixelColor(7, pixels.Color(255, 255, 255));
  30. pixels.setPixelColor(8, pixels.Color(255, 255, 255));
  31. pixels.setPixelColor(9, pixels.Color(255, 255, 255));
  32.  
  33. pixels.show();
  34. }
RAW Paste Data