Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/26/03 16:58
Read: times


 
#37333 - RE: Accessing individual bits

you can make definitions as..
#define TRUE 0x01
#define FALSE 0x00

and use as..
P1.0 = FALSE

you can define pins..

sbit selfdestruct_pin = P1^1;
so
selfdestruct_pin = TRUE;

you can also alias bits in variable's as..
bdata U8 General_flags;

sbit flag1=General_flags^0;
sbit flag2=General_flags^1;

so..
flag1=TRUE;
flag2=TRUE;
will set General_flags to 0x03

and
General_flags=0;
will clear flag1 and flag2






List of 6 messages in thread
TopicAuthorDate
Accessing individual bits            01/01/70 00:00      
RE: Accessing individual bits            01/01/70 00:00      
RE: Accessing individual bits            01/01/70 00:00      
RE: Accessing individual bits            01/01/70 00:00      
RE: Accessing individual bits            01/01/70 00:00      
RE: Accessing individual bits            01/01/70 00:00      

Back to Subject List