Page 1 of 1

Read input binairy value with GPIO_Read

Posted: Wed Oct 27, 2010 5:16 pm
by Tubes4sale
How to read a specific input with GPIO_Read(). It returns a HEX value, don't know how to get the binairy value, for example input14.
Thanks

Re: Read input binairy value with GPIO_Read

Posted: Wed Oct 27, 2010 7:32 pm
by xol
To get input 14:

Code: Select all

result = GPIO_read(...);
input14 = (result >> 14) & 0x01;