Index
 
  Reference for Wiring 1.0 (ALPHA) 0017+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Name  

bit

   
Examples  
byte a = bit(0);	// Declare variable "a" and assigns a number with the bit 0 set to 1: 00000001 (1 in decimal) 
byte b = bit(2);    // Declare variable "b" and assigns a number with the bit 2 set to 1: 00000100 (4 in decimal) 

Description   The bit command returns a byte with the requested bit set to 1.
   
Syntax  
var = bit(value)
   
Parameters  
value   int: the bit to set to 1 (can be from 0 to 7)

var   byte: a byte variable to assign the value returned by the bit command

   
Returns  
   
Usage   Application
   
Related   bitRead()
bitWrite()
lowByte()
highByte()
makeWord()