#使用mixly实现数码管显示秒表
代码:
#include <SevenSegmentExtended.h>
#include <SevenSegmentTM1637.h>
SevenSegmentExtended display(A5,4);
volatile int min2;
volatile int second;
void setup(){
second = 1;
min2 = 0;
display.begin();
}
void loop(){
display.printTime(min2,second,HIGH);
delay(100);
second = second + 1;
if (second == 60) {
min2 = min2 + 1;
second = 0;
}
if (min2 == 60) {
min2 = 0;
second = 0;
}
}
##代码块: