完成:实验二
This commit is contained in:
@@ -20,7 +20,8 @@
|
|||||||
"Debug": {
|
"Debug": {
|
||||||
"excludeList": [
|
"excludeList": [
|
||||||
"src/test1.c",
|
"src/test1.c",
|
||||||
"src/test2.c"
|
"src/test2.c",
|
||||||
|
"src/test3.c"
|
||||||
],
|
],
|
||||||
"toolchain": "Keil_C51",
|
"toolchain": "Keil_C51",
|
||||||
"compileConfig": {
|
"compileConfig": {
|
||||||
|
|||||||
+17
-8
@@ -1,11 +1,20 @@
|
|||||||
//test4.c
|
// test4.c
|
||||||
//让2个LED灯交替闪烁
|
// 让2个LED灯交替闪烁
|
||||||
#include <reg52.h>
|
#include <reg52.h>
|
||||||
#include "homework2.h"
|
#include "homework2.h"
|
||||||
void main(){
|
void main()
|
||||||
ENLED = 0;
|
{
|
||||||
ADDR3 = 1;
|
ENLED = 0;
|
||||||
ADDR2 = 1;
|
ADDR3 = 1;
|
||||||
ADDR1 = 1;
|
ADDR2 = 1;
|
||||||
ADDR0 = 0;
|
ADDR1 = 1;
|
||||||
|
ADDR0 = 0;
|
||||||
|
while (1) {
|
||||||
|
D1 = 0;
|
||||||
|
D2 = 1;
|
||||||
|
Delay(100000);
|
||||||
|
D1 = 1;
|
||||||
|
D2 = 0;
|
||||||
|
Delay(100000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user