Framework (A-Z)

Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.

Name

bitRead()

Examples
// sets x to 33 (00100001 in binary)
byte x = 33; 
// Sets a = 1, since bitRead returns the value of the 5th bit of variable x
byte a = bitRead(x, 5);
Description The bitRead command returns the bit value of the bit index requested
Syntax
var = bitRead(byteValue, bitIndex)
Parameters
byteValue byte: the byte from which read the bit
bitIndex int: the bit to read
Returns the bit value 0 or 1
Usage Application
Related bit()
bitWrite()
lowByte()
highByte()
makeWord()
Updated on July 07, 2011 11:07:52pm PDT

Creative Commons License