Download 2/3.1.c from Beifengdo/Microcontrollers: direct link, hf CLI and curl.
- Browser
- Download file 547 Bytes
-
https://huggingface.co/datasets/Beifengdo/Microcontrollers/resolve/main/2/3.1.c
- Command line
-
hf download hf://datasets/Beifengdo/Microcontrollers/2/3.1.c
-
curl -L -o 3.1.c https://huggingface.co/datasets/Beifengdo/Microcontrollers/resolve/main/2/3.1.c
547 Bytes
| //sbit LED1 = P2^0; | |
| //sbit LED2 = P2^1; | |
| //sbit LED3 = P2^2; | |
| //sbit LED4 = P2^3; | |
| //sbit LED5 = P2^4; | |
| //sbit LED6 = P2^5; | |
| //sbit LED7 = P2^6; | |
| //sbit LED8 = P2^7; | |
| unsigned char i; | |
| void main(){ | |
| TMOD = 0x01;//T0 fangshi 1 dingshi | |
| TR0 = 1;//qidong | |
| i = 10;//20 | |
| P1 = 0xF0; | |
| while(1){ | |
| TH0 = 15536/256;//gaobawei chuzhi | |
| TL0 = 15536%256;//dibawei chuzhi | |
| while(TF0 == 0);//waiting for yichu | |
| TF0 = 0;//TF ruanjianqingling | |
| i--;//yigezhouqishi 100ms xitongshizhong 6MHZ | |
| if (i==0){ | |
| P1 = ~P1;//qufan | |
| i = 10;//20 | |
| } | |
| } | |
| } | |