Jorge Andres Reyes Alvarez

Problem with "bit" variables

Discussion created by Jorge Andres Reyes Alvarez on Mar 1, 2009
Latest reply on Mar 2, 2009 by Daniel Lundin

I don´t know if i can do this...This is an example of what i want to do:

 

Bit my_name_function(void) {                  ; i want to return only one bit.

 

byte temp;

 

temp=PTDD;                                         ;temp = port D of the MC, 8 bits.

 

return ((bit)(temp&0x80));                      ;i just want to return the last bit of PTDD

 

}

 

How can i do this? the bit data type doesnt exist in codewarrior as in other compilers...What can i do to do this in codewarrior?

 

thanks

Outcomes