rpi-led-control.js
function setDigit(addr, digit, value, dp){
	    if(addr<0 || addr>=maxDevices)
			throw 'address out of range';
		if(digit<0 || digit>7) 
			throw 'invalid digit number'; 
		if(value<0 || value >15) throw 'number out of range'; 
			
		var offset = addr*8;
		var v = charTable[value];//.toString(16)]; 

		if(dp) v|=0x80; // set the decimal point bit if necessary
		
		status[offset+digit] = v; 
		spiTransfer(addr, digit+1, v); 
	
	}
function setDigit(addr, digit, value, dp){
	    if(addr<0 || addr>=maxDevices)
			throw 'address out of range';
		if(digit<0 || digit>7) 
			throw 'invalid digit number'; 
		if(value<0 || value >15) throw 'number out of range'; 
			
		var offset = addr*8;
		var v = charTable[value];//.toString(16)]; 

		if(dp) v|=0x80; // set the decimal point bit if necessary
		
		status[offset+digit] = v; 
		spiTransfer(addr, digit+1, v); 
	
	}
function setDigit ( addr , digit , value , dp ) { if ( addr < 0 || addr >= maxDevices ) throw 'address out of range' ; if ( digit < 0 || digit > 7 ) throw 'invalid digit number' ; if ( value < 0 || value > 15 ) throw 'number out of range' ; var offset = addr * 8 ; var v = charTable [ value ] ; //.toString(16)];  if ( dp ) v |= 0x80 ; // set the decimal point bit if necessary status [ offset + digit ] = v ; spiTransfer ( addr , digit + 1 , v ) ; }
/*
Display a hexadecimal digit on a 7-Segment Display
Params:
addr	address of the display
digit	the position of the digit on the display (0..7)
value	the value to be displayed. (0x00..0x0F)
dp	sets the decimal point.
/ * Display a hexadecimal digit on a 7 - Segment Display Params : addr address of the display digit the position of the digit on the display ( 0 .. 7 ) value the value to be displayed . ( 0x00 .. 0x0F ) dp sets the decimal point .