Read input binairy value with GPIO_Read

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
Tubes4sale
Posts: 7
Joined: Thu Jan 28, 2010 7:15 am

Read input binairy value with GPIO_Read

Post 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

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: Read input binairy value with GPIO_Read

Post by xol »

To get input 14:

Code: Select all

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

Post Reply