Datasets:
Download 8/8.c from KeLe-open-code/MCU: direct link, hf CLI and curl.
- Browser
- Download file 556 Bytes
-
https://huggingface.co/datasets/KeLe-open-code/MCU/resolve/main/8/8.c
- Command line
-
hf download hf://datasets/KeLe-open-code/MCU/8/8.c
-
curl -L -o 8.c https://huggingface.co/datasets/KeLe-open-code/MCU/resolve/main/8/8.c
556 Bytes
| unsigned char count = 0; | |
| void timer0(void) interrupt 1 | |
| { | |
| TH0 = (65536UL - 50000) / 256; | |
| TL0 = (65536UL - 50000) % 256; | |
| count++; | |
| if (count == 20) | |
| { | |
| count = 0; | |
| P2 = ~P2; | |
| } | |
| } | |
| void main(void) | |
| { | |
| P2 = 240; | |
| TMOD = 1; | |
| TH0 = (65536UL - 50000) / 256; | |
| TL0 = (65536UL - 50000) % 256; | |
| ET0 = 1; | |
| EA = 1; | |
| TR0 = 1; | |
| while (1); | |
| } | |