Download 2/3.2.c from Beifengdo/Microcontrollers: direct link, hf CLI and curl.
- Browser
- Download file 447 Bytes
-
https://huggingface.co/datasets/Beifengdo/Microcontrollers/resolve/main/2/3.2.c
- Command line
-
hf download hf://datasets/Beifengdo/Microcontrollers/2/3.2.c
-
curl -L -o 3.2.c https://huggingface.co/datasets/Beifengdo/Microcontrollers/resolve/main/2/3.2.c
447 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 x; | |
| void time1() interrupt 0 { | |
| if (P1 != 0xFF) { | |
| P1 = (P1 << 1) | 0x01; | |
| } else { | |
| P1 = 0xFE; | |
| } | |
| //x = 0xFE; | |
| //x = _crol_(x,1); | |
| //P1 = x; | |
| } | |
| void main(){ | |
| IE = 0X85; | |
| IT0 = 1; | |
| P1 = 0xFE; | |
| while(1); | |
| } | |