Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Interfacing / Re: Sparkfun SerLCD on: February 14, 2007, 01:07:34 pm
Hi,
I have a simple project that talks to the Sparkfun serial LCD board.  Here it is, so enjoy.  This was built off the LCD project here, with a few changes.  Not all of the fuctions are working just yet, as it appears that the LCD needs a few commands added.  


Bob


//  *
//  * ------------
//  *  Control a Serial LCD Display
//  *  
//  *  Tested on a Matrix Orbital model LCD0821 display.
//  *  Other diplays will work but may have slightly different
//  *  command codes and hardware setups.
//  *  
//  *  Copyleft 2006 by djmatic
//  *  
//  * More copyleft 2007 Bob Grabau
//  *   ------------
//  *
//  *

// Definitions for the SparkFun SerLCD version 2 code.

#define BLINK_ON 0x0d
#define BLINK_OFF 0x0c
#define DISPLAY_ON 0x0c
#define DISPLAY_OFF 0x08
#define SHIFT_RIGHT 0x1c
#define SHIFT_LEFT 0x18
#define BACKLIGHT_OFF  128
#define BACKLIGHT_40   140
#define BACKLIGHT_70   150
#define BACKLIGHT_FULL 157

// Declare your program variables here


// Arduino and LCD setup

void setup()
{
  // Communication to the Serial LCD display is defaulted to 9600 baud.
  beginSerial(9600);
}


//  MAIN CODE

void loop()
{
  clearLCD();
  Serial.print(" Hello Arduino");  // print text to the current cursor position
  newLine();               // start a new line
  Serial.print("Frm SparkFun V2");
  cursorOn();
  delay(5000);
  cursorHome();
  delay(5000);
  cursor(BLINK_ON);
  delay(5000);
  cursor(BLINK_OFF);
  cursorOff();
  delay(5000);
  cursor(DISPLAY_OFF);
  delay(5000);
  cursor(DISPLAY_ON);
  delay(5000);
  cursor(SHIFT_RIGHT);
  delay(5000);
  cursor(SHIFT_LEFT);
  delay(5000);
  Set_Backlight(BACKLIGHT_OFF);
  delay(1000);
  Set_Backlight(BACKLIGHT_40);
  delay(1000);
  Set_Backlight(BACKLIGHT_70);
  delay(1000);
  Set_Backlight(BACKLIGHT_FULL);
  delay(5000);
}


//  LCD  FUNCTIONS-- keep the ones you need.

// clear the LCD
void clearLCD()
{
  Serial.print(254, BYTE);
  Serial.print(1, BYTE);
}

// start a new line
void newLine()
{
  Serial.print(254, BYTE);
  Serial.print(0xC0, BYTE);
}

// general cursor / display command routine
void cursor(int Mode)
{
  Serial.print(254, BYTE);
  Serial.print(Mode, BYTE);
}

// move the cursor to the home position
void cursorHome()
{
  Serial.print(254, BYTE);
  Serial.print(2, BYTE);
}

// turn the cursor on
void cursorOn()
{
  Serial.print(254, BYTE);
  Serial.print(0x0E, BYTE);
}

// turn the coursor off
void cursorOff()
{
  Serial.print(254, BYTE);
  Serial.print(0x0C, BYTE);
}

// move the cursor to a specific place
// e.g.: cursorSet(3,2) sets the cursor to x = 3 and y = 2
void cursorSet(int xpos, int ypos)
{  
#define HSIZE 16
#define VSIZE 2
  int pos;
  pos = (ypos * HSIZE) + xpos;
  pos += 0x80;

  // cur pos still broken
  Serial.print(pos, HEX);

  Serial.print(254, BYTE);
  Serial.print(pos, BYTE);
}

// backspace and erase previous character
void backSpace()
{
  //  Serial.print(8, BYTE);
}

// move cursor left
void cursorLeft()
{    
  //  Serial.print(254, BYTE);
  //  Serial.print(76, BYTE);  
}


// move cursor right
void cursorRight()
{
  //  Serial.print(254, BYTE);
  //  Serial.print(77, BYTE);  
}

// set LCD contrast
void setContrast(int contrast)
{
  //  Serial.print(254, BYTE);
  //  Serial.print(80, BYTE);  
  //  Serial.print(contrast);  
}

// turn on backlight
void backlightOn(int minutes)
{
  //  Serial.print(254, BYTE);
  //  Serial.print(66, BYTE);  
  //  Serial.print(minutes); // use 0 minutes to turn the backlight on indefinitely  
}

// Set the backlight by value
void Set_Backlight(int val)
{
  Serial.print(124, BYTE);
  Serial.print(val, BYTE);  
}
2  Forum 2005-2010 (read only) / Bar Sport / Re: Pizza oscar at La Lucciola's on: February 20, 2009, 11:37:36 am
Ah, The Wine and the fog.  Oh yeah.  I worked for Olivetti from 81-87 and made numerous trips to Ivrea.  I enjoyed them all.  Also it was interesting to go up to Aosta valley and visit many of the Roman castles the lined to valley.  One of the many nice things about Ivrea, was the food.  There was a restaurant a few blocks from the hotel (La Serra) which did not even have a written menu.  Each night the "menu" would change as the owner / chief had a different meal for the night.  Their son was the waiter, and they only have maybe 5 tables total.
I was talking with my best friend, who also worked for Olivetti, and for 2 years lived in Ivrea, and we were talking about Pizza Oscar.  I was hoping that someone who has been to, and / or lives in Ivrea would know the toppings of a Pizza Oscar.
I must confess, that one trip to Ivrea, which was 3 weeks long, I got a little tired of the food at the restaurants there.  That weekend we drove up to Geneva and went to a Wendy, here in the US it is called Wendy's, and had a burger and fries.
One of the things I really miss the most was after dinner, it was very common to get a cafe con grappa.  Something the italian restaurants here don't even know anything about.  Heck, most don't even know what grappa is.
3  Forum 2005-2010 (read only) / Bar Sport / Pizza oscar at La Lucciola's on: February 18, 2009, 09:05:14 pm
For those who live in Ivrea, What are the ingredients of a Pizza Oscar from La Lucciola resturant.   Also, is a Quattro Stagione the same as a Pizza Oscar minus the egg?   It has beeen over 2 decades since I was in Ivrea for Olivetti.    Thanks!
4  Forum 2005-2010 (read only) / Bar Sport / Where are the boards made? on: January 29, 2007, 08:55:12 pm
As I saw someplace on this site, the boards are made in Ivera, It?  Is this true?  The reason I ask is that during the 80's I worked for Olivetti, and had the pleasure of visiting Ivera numerous times.  My best freind and his wife lived in Ivera (and also worked for Olivetti) for 2 years.

Thanks,

Bob
Pages: [1]