前言:
学习arduino绕不开输入输出操作,网购了这个模块,做个学习记录
目的:了解TM1638输入输出库文件函数的使用
环境:ARDUINO uno主板,下图TM1638模块,
软件环境:mixly:2.0 rc4; TM1638plus.h;
void Test0()
{
// Test 0 reset test
tm.setLED(6, 1); //将LED7点亮
delay(myTestDelay);
tm.reset(); //?
}
void Test1() {
// Test 1 Brightness and reset
for (uint8_t brightness = 0; brightness < 8; brightness++)
{
tm.brightness(brightness);
tm.displayText("00000000");//"00000000"
delay(myTestDelay1);
}
tm.reset();
// restore default brightness
tm.brightness(0x02);
}
void Test2() {
//Test 2 ASCII , display 2.341
tm.displayASCIIwDot(0, '2');
tm.displayASCII(1, '3');
tm.displayASCII(2, '4');
tm.displayASCII(3, '1');
delay(myTestDelay3);
tm.reset();
}
void Test3() {
//TEST 3 single segment (digit position, (dp)gfedcba)
// (dp)gfedcba = seven segments positions
//display7Seg(pos, 1<<7-pos);
//display7Seg(pos, 1<<6-pos);
//上面2行代码会闪烁?
uint8_t pos = 0;
for (pos = 0 ; pos<8 ; pos++)
{
tm.display7Seg(pos, 1<<7-pos); // Displays a single seg in (dp)gfedcba) in each pos 0-7
delay(myTestDelay1);
}
}