123456789101112131415161718192021222324252627282930313233343536373839 |
- #include "display.h"
- #include <TM1637Display.h>
- //#include "tm1637.h"
- #include <esp_system.h>
- const int display_clk = 21;
- const int display_dio = 22;
- TM1637Display display(display_clk, display_dio);
- //tm1637_led_t *lcd;
- void display_setup(void) {
- uint8_t data[] = { 0xff, 0xff, 0xff, 0xff };
- display.setBrightness(0x0a);
- display.setSegments(data);
- switch (esp_random() % 5) {
- case 0:
- display.showNumberDecEx(1223, 0b11100000, true); //Display the numCounter value;
- break;
- case 1:
- display.showNumberDecEx(2016, 0b11100000, true); //Display the numCounter value;
- break;
- case 2:
- display.showNumberDecEx(1998, 0b11100000, true); //Display the numCounter value;
- break;
- case 3:
- display.showNumberDecEx(8008, 0b11100000, true); //Display the numCounter value;
- break;
- case 4:
- display.showNumberDecEx(531, 0b11100000, false); //Display the numCounter value;
- break;
- case 5:
- display.showNumberDecEx(5537, 0b11100000, true); //Display the numCounter value;
- break;
- }
- return;
- }
- //see https://github.com/avishorp/TM1637/blob/master/examples/TM1637Test/TM1637Test.ino
|