完成:实验三 第一题

This commit is contained in:
2025-03-25 13:11:20 +08:00
parent f9016dcc62
commit b4a3a188fe
3 changed files with 100 additions and 42 deletions
+28
View File
@@ -0,0 +1,28 @@
// test1.c
// 左向流水灯
#include "homework3.h"
unsigned char cnt = 0;
void test1()
{
ENLED = 0;
ADDR3 = 1;
ADDR2 = 1;
ADDR1 = 1;
ADDR0 = 0;
while (true) {
P2 = ~(0x80 >> cnt);
Delay(20000);
cnt++;
if (cnt >= 8) {
cnt = 0;
}
}
}
void main()
{
test1();
}