完成:实验二 第三题
This commit is contained in:
@@ -19,7 +19,8 @@
|
||||
"targets": {
|
||||
"Debug": {
|
||||
"excludeList": [
|
||||
"src/test1.c"
|
||||
"src/test1.c",
|
||||
"src/test2.c"
|
||||
],
|
||||
"toolchain": "Keil_C51",
|
||||
"compileConfig": {
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// test3.c
|
||||
// 同时让多个LED灯闪烁
|
||||
#include <reg52.h>
|
||||
#include "homework2.h"
|
||||
void main()
|
||||
{
|
||||
ENLED = 0;
|
||||
ADDR3 = 1;
|
||||
ADDR2 = 1;
|
||||
ADDR1 = 1;
|
||||
ADDR0 = 0;
|
||||
while (1) {
|
||||
D1 = 0;
|
||||
D2 = 0;
|
||||
D3 = 0;
|
||||
D4 = 0;
|
||||
D5 = 0;
|
||||
D6 = 0;
|
||||
D7 = 0;
|
||||
D8 = 0;
|
||||
Delay(100000);
|
||||
D1 = 1;
|
||||
D2 = 1;
|
||||
D3 = 1;
|
||||
D4 = 1;
|
||||
D5 = 1;
|
||||
D6 = 1;
|
||||
D7 = 1;
|
||||
D8 = 1;
|
||||
Delay(100000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user