#include "TM1637.h" TM1637 tm1637(9,10); int x = 0; void setup() { tm1637.init(); tm1637.set(BRIGHT_TYPICAL); } void loop() { x = x + 1; tm1637.point(POINT_OFF); if (x >= 100000) {tm1637.display(2,(x/long(pow(10, 5)))%10);} else { tm1637.display(2,17);} if (x >= 10000) {tm1637.display(1,(x/long(pow(10, 4)))%10);} else { tm1637.display(1,17);} if (x >= 1000) {tm1637.display(0,(x/long(pow(10, 3)))%10);} else { tm1637.display(0,17);} if (x >= 100) {tm1637.display(5,(x/long(pow(10, 2)))%10);} else { tm1637.display(5,17);} if (x >= 10) {tm1637.display(4,(x/long(pow(10, 1)))%10);} else { tm1637.display(4,17);} tm1637.display(3,(x/long(pow(10, 0)))%10); delay(500); }
Открыть пример: Online ArduBlock
Видеоурок: