Hi

can anyone help me please i want to know in the fsuipc expert function how can i read the bit value. If i want to get value of offset 04F0 bit 3 how can i?
Thank you in advance for any help.

2. ## Re: Link2fs 6b question

Hi mo_nithi,
3rd bit to test : 0b00000100(binary) = 4(decimal) = 0x4(hexadecimal)
4th bit to test : 0b00001000(binary) = 8(decimal) = 0x8(hex)
7th bit to test : 0b01000000(binary) = 64(decimal) = 0x40(hex)
example
suppose your value=content of offset 0x04f0 and test 3rd bit of the value

if((value & 4) == 4) { do what you want if bit=1 } else { do what you want if bit=0}

ryan

3. ## Re: Link2fs 6b question

Originally Posted by Ryan007
Hi mo_nithi,
...
suppose your value=content of offset 0x04f0 and test 3rd bit of the value

if((value & 4) == 4) { do what you want if bit=1 } else { do what you want if bit=0}

ryan
Oh! THAT's how you do it. Learn something new everyday. I was wondering that myself. Thanks Ryan!

4. ## Re: Link2fs 6b question

The solution I gave is more a generic c/c++ solution
There are many way to do that, and I saw there is something more simple in the arduino reference pages
if(bitRead(value,2)) { do what you want if 3rd bit of value =1 }