Created
July 2, 2021 15:28
-
-
Save alsamitech/b9c0eeb9fd3b3b1a01c5bb08632ddb11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define BIT_0 1 | |
| #define BIT_1 2 | |
| #define BIT_2 4 | |
| #define BIT_3 8 | |
| #define BIT_4 16 | |
| #define BIT_5 32 | |
| #define BIT_6 64 | |
| #define BIT_7 128 | |
| void bitchar(char* s, char c){ | |
| for(unsigned char i=0;i<8;i++){ | |
| s[i] = c & 0x80 ? '1' : '0'; | |
| c <<= 1; | |
| } | |
| s[8]=0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment