i got a feeling io'm gona punch myself in the face after i see the answer to this, because it was so simple. so here goes....
I have a 16 bit number that is a global variable, we will call it global1. I want to put this into a function so that whenever I want to change a bit or two I can call this function with the bit to change. Here is a small example.
now, the below is not elegant, but you get the idea. the first function call changes bit 4 to a 1 and the second call changes bit 4 to a 0. it does this without affecting any of the other bits in there.
Now, what I am searching for since the obvious has not hit me is a nice formula to do the same thing without the "IF" statements.
void ChangeBit(char data, unsigned int rotating)
global1 |= (1 << rotating);
global1 &=~ (1 << rotating);