Stumbling upon this thread... here is my code for interfacing with the Sparkfun 4 digit, 7-segment LCD via SPI. It demonstrates some of the various command bytes and wraps up most of the functionality into a single function call (once initialized).

I do have one bug yet to be worked out... on initial reset the display usually reads fine, however upon a subsequent reset the display usually turns to "junk" (random elements lit). Pressing the reset button again doesn't fix it but closing and reopening the Serial Monitor always does fix it. I'm guessing it has something to do with the power up sequence of the LCD uC? Any help with this would be greatly appreciated.

//this project demonstrates SPI control of sparkfun 4 digit, 7-segment LCD//Setup section demonstrates commanding the LCD via SPI using byte commands. //Loop section demonstrates a counting timer uses SendToLCD() function to simplify ////project by Scott Josselyn////note that there are different firmware versions for the sparkfun part that may not support all functions//Part Product Page: http://www.sparkfun.com/commerce/product_info.php?products_id=9230//Part Reference Manual: http://www.sparkfun.com/datasheets/Components/LED/SFE-0012-DS-7segmentSerial-v3.pdf

//the following configures the lcd delay(200); //not sure if this is required or not but want to make sure the LCD uC has finished loading after powerup //configure the pins for SPI communication pinMode(MOSI, OUTPUT); pinMode(SCLK, OUTPUT); pinMode(LCD_CS, OUTPUT); digitalWrite(LCD_CS, LOW); //this should be moved to inside the function

//now send it to the LCD (but only if display needs to be changed since last time) if (outToLCD != lastOutToLCD) {//begin check for new display data SendToLCD( outToLCD, decimalBitCode); //send to terminal for debugging Serial.print(mins, DEC); Serial.print(":"); Serial.println(secs, DEC); }; //end if check for new display data

//update our variable that keeps track of what it was last time. lastOutToLCD = outToLCD;

}//end loop

void SendToLCD( int n, byte decimalCode){ //takes an unsigned int, converts to bcd and outputs the least 4 sig digits to the LCD and places //decimals on display are defined defined by decimalCode