getting the least significant bit from a byte
hi everyone,
this sure easy task c experts out here in forum, hard me. communication i2c device need determine if specific bit set or not in byte i'm receiving wire library (this contains status update on if or if not there's new value ready read).
i.e. byte b = 110 // (or 0x6 in hex) need check if '0' '0' independently other bits
i hope clear i'm trying do? in advance help. once i'm getting communication between arduino , ad7746 running i'll post code. (if know how head forward -> http://www.arduino.cc/cgi-bin/yabb2/yabb.pl?num=1239676788)
best,
stephan
this sure easy task c experts out here in forum, hard me. communication i2c device need determine if specific bit set or not in byte i'm receiving wire library (this contains status update on if or if not there's new value ready read).
i.e. byte b = 110 // (or 0x6 in hex) need check if '0' '0' independently other bits
i hope clear i'm trying do? in advance help. once i'm getting communication between arduino , ad7746 running i'll post code. (if know how head forward -> http://www.arduino.cc/cgi-bin/yabb2/yabb.pl?num=1239676788)
best,
stephan
http://arduino.cc/en/reference/bitread
the arduino way:
the arduino way:
code: [select]
byte x = b001;
boolean leastsignificant = bitread(x,0);
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > getting the least significant bit from a byte
arduino
Comments
Post a Comment