counter.ino 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Edgelit "counter" example
  3. * Counts from 0 to 4,294,967,295 with transitions and theming
  4. */
  5. #include "Edgelit.h"
  6. #define DATA_PIN 5 // Pin "D1" using Wemos D1 mini's stupid labels
  7. #define DISPLAY_COUNT 6 // Number of displays in chain
  8. #define DISPLAY_TYPE LIXIE_1 // Type of display (LIXIE_1, NIXIE_PIPE, etc.)
  9. Edgelit lit(DATA_PIN, DISPLAY_COUNT, DISPLAY_TYPE);
  10. uint32_t count = 0;
  11. void setup(){
  12. lit.begin(); // Initialize the interrupts for animation
  13. lit.transition_type(FADE_TO_BLACK); // Can be INSTANT, CROSSFADE, or FADE_TO_BLACK
  14. lit.transition_time(250); // Transition time in milliseconds. (Does nothing for INSTANT transitions)
  15. lit.nixie(1); // Sets the color scheme to match the ionized neon/argon mix in an average Nixie tube.
  16. // The 1 is "Argon intensity", the subtle blue hue some Nixie tubes have. (0-255)
  17. // Some other display presets to try:
  18. // lit.vfd_green();
  19. // lit.vfd_blue();
  20. // Or a theme of your own:
  21. // lit.color(CRGB(255,255,255), FRONT); // "FRONT" is coloring for numerals shown
  22. // lit.color(CRGB(0,8,2), BACK); // "BACK" is coloring for numerals not shown. (Background)
  23. }
  24. void loop() {
  25. lit.write(count);
  26. count++;
  27. delay(500);
  28. }