??? 05/31/05 16:00 Read: times |
#94151 - BIts! Responding to: ???'s previous message |
A bit is a 0 or 1
while(P0^7==1)dostuff(); //OK while(P0^7)dostuff(); //OK while( (P0 & 0x80) == 1)dostuff(); //The same, but C will make more code while( (P0^7 & 0xF0) == 1)dostuff(); N0 This is the same as (0x01 & 0xF0) and (0x00 & 0xF0) It can never be true. "Treat" bits as an unsigned char that can only be a 0 or 1. You can add them to number and such. Just becuase it is the high bit in the byte, it does not matter. It gets treated as the low bit. If you need to mask, mask the Byte |
Topic | Author | Date |
Keil: getting input | 01/01/70 00:00 | |
If it works in ASM it Works in C | 01/01/70 00:00 | |
Why C?! | 01/01/70 00:00 | |
Irrelevant | 01/01/70 00:00 | |
Of Course | 01/01/70 00:00 | |
key scan | 01/01/70 00:00 | |
Delay.. | 01/01/70 00:00 | |
Delay | 01/01/70 00:00 | |
Software Delay Loops | 01/01/70 00:00 | |
Software Delay Loops | 01/01/70 00:00 | |
Learning 'C' | 01/01/70 00:00 | |
to be precise.. | 01/01/70 00:00 | |
Debounce | 01/01/70 00:00 | |
completely missed it.. | 01/01/70 00:00 | |
to be precise... | 01/01/70 00:00 | |
Sorry Leo ! | 01/01/70 00:00 | |
Inferences | 01/01/70 00:00 | |
Right answer, wrong reason | 01/01/70 00:00 | |
and therefore | 01/01/70 00:00 | |
Congratulations | 01/01/70 00:00 | |
to: Raghu Sir![]() | 01/01/70 00:00 | |
BIts! | 01/01/70 00:00 |