Download 4/4.c from KeLe-open-code/MCU: direct link, hf CLI and curl.
- Browser
- Download file 399 Bytes
-
https://huggingface.co/KeLe-open-code/MCU/resolve/main/4/4.c
- Command line
-
hf download hf://KeLe-open-code/MCU/4/4.c
-
curl -L -o 4.c https://huggingface.co/KeLe-open-code/MCU/resolve/main/4/4.c
399 Bytes
| sbit K1 = P3^0; | |
| sbit K2 = P3^1; | |
| sbit K3 = P3^2; | |
| sbit K4 = P3^3; | |
| void main(void) | |
| { | |
| P2 = 0xFF; | |
| while (1) | |
| { | |
| if (K1 == 0) | |
| P2 = 0xFE; | |
| else if (K2 == 0) | |
| P2 = 0xFC; | |
| else if (K3 == 0) | |
| P2 = 0xF8; | |
| else if (K4 == 0) | |
| P2 = 0xF0; | |
| else | |
| P2 = 0xFF; | |
| } | |
| } | |