floating_point.ino 623 B

1234567891011121314151617
  1. #include <Lixie_II.h> // https://github.com/connornishijima/Lixie_II
  2. #define DATA_PIN 13 // Lixie DIN connects to this pin (D7 on Wemos)
  3. #define NUM_DIGITS 4
  4. Lixie_II lix(DATA_PIN, NUM_DIGITS);
  5. void setup() {
  6. lix.begin();
  7. lix.transition_type(INSTANT); // Defaults to CROSSFADE of 250ms
  8. lix.gradient_rgb(ON, CRGB(0,255,0), CRGB(0,255,255)); // Gradient from green to cyan
  9. }
  10. void loop() {
  11. uint32_t time_millis = millis();
  12. float seconds = time_millis / 1000.0;
  13. lix.write_float(seconds, 2); // Writes a floating point number (of the seconds elapsed) with 2 decimal places.
  14. delay(1);
  15. }