Mixly 数码管时钟实验
程序员文章站
2022-05-28 10:06:12
...
Mixly 数码管时钟实验
给出实验一代码
#include <SevenSegmentTM1637.h>SevenSegmentTM1637
display(6,7);
void setup(){
display . begin();
while (true) {
delay(1000);
display . print( "234510");}
void loop(){
}
实验一的组块拼接
实验二代码
#include <SevenSegmentExtended . h>#include <SevenSegmentTM1637 .h>SevenSegmentExtended
display(6,7);
void setup(){
display .begin();
display. printTime(11, 30 , HIGH);}
void loop(){
}
实验二的组块拼接
实验三的代码
void TimeUpdate2(void)
{if (ClockPoint )tm1637 . point(POINT_ _ON) ;
else tm1637 . point(POINT_ _OFF);
TimeDisp[2] = _ microsecond_ _10 / 10;
TimeDisp[3] =_ microsecond_ 10 % 10;
TimeDisp[0] =_ second / 10;
TimeDisp[1]= second % 10;
Update = OFF;
}
void TimingISR2( ){
microsecond_ 10 t+;
Update = ON;
if (microsecond_ 10 == 100){
second ++;
if(second == 60){
second = 0;
microsecond_ 10 = 0;
}
ClockPoint =( ~ClockPoint) & 0x01;
if(Flag_ ReadTime == 0)
f_ microsecond_ 10 = microsecond_ 10;
second = second;
}
}
实验三的组块拼接
上一篇: 使用canvas 画钟表