RE: reading indivivual bits in a byte var

You can use a union to map bit variables onto a byte variable.

union bitvars
{
        unsigned char byte;
        struct
        {
                unsigned     bit0:1;
                unsigned     bit1:1;
                unsigned     bit2:1;
                unsigned     bit3:1;
                unsigned     bit4:1;
                unsigned     bit5:1;
                unsigned     bit6:1;
                unsigned     bit7:1;
        } bits;
}

union bitvars control;
control.byte = 0xAA;    /* use the variable as an unsigned char */

if(control.bits.bit0 == 0)      /* or access the bits individually */
{
}
etc...etc...

Regards

Mike Rigby-Jones