Skip to content

Instantly share code, notes, and snippets.

@boxalljohn
Created July 15, 2013 10:46
Show Gist options
  • Select an option

  • Save boxalljohn/5999102 to your computer and use it in GitHub Desktop.

Select an option

Save boxalljohn/5999102 to your computer and use it in GitHub Desktop.
/*
Arduino demo sketch using Peter H. Anderson serial LCD chip - http://www.phanderson.com
by John Boxall - http://tronixstuff.wordpress.com - 19/04/2010
*/
float noisy = 0;
void setup()
{
Serial.begin(2400); // am using 2400bps serial LCD chip, therefore this line is required
randomSeed(analogRead(0)); // reseed the random number generator with some noise
delay (5000); // the serial LCD chip needs about five seconds to boot up
}
void loop()
{
// setup the chip parameters
Serial.print("?G216"); // define the LCD as 2 rows by 16 characters
delay (1000); // need a delay between each instruction to the serial LCD chip
Serial.print("?C0tronixstuff.com "); // next two define the boot-up message displayed. This can also be delayed on call using "?*"
delay (1000);
Serial.print("?C1* part review * "); // you need to fill the entire 16 characters
delay (1000);
Serial.print("?S2"); // chip will display boot message every time it is reset
delay (1000);
Serial.print("?*"); // display boot message as defined above
delay (5000);
// now some displaying...
for (int j = 1; j<9999; j++)
{
Serial.print("?f"); //clear the screen
delay (500);
Serial.print("all your base");
delay (500);
Serial.print("?n"); // move cursor to start of next line
delay(1000);
Serial.print("... belong to us");
delay (2000);
Serial.print("?f"); //clear the screen
delay (500);
Serial.print("?*"); // display boot message as defined above
delay (5000);
Serial.print("?f"); //clear the screen
delay (500);
// display some random numbers
Serial.print("Random Numbers!");
Serial.print("?n"); // move cursor to start of next line
for (int i = 1; i<5; i++)
{
noisy=random(1000);
Serial.print("Number: ");
Serial.print(noisy,0);
delay (1000);
Serial.print("?m"); // move cursor to start of the current line
}
Serial.print("?f"); //clear the screen
delay (500);
Serial.print("?*"); // display boot message as defined above
delay (5000);
Serial.print("?f"); // clear screen
Serial.print("Earth");
delay(500);
Serial.print(".");
delay(500);
Serial.print(".");
delay(500);
Serial.print(".");
delay(500);
Serial.print("?n"); // move cursor to start of next line
delay(500);
Serial.print("Mostly harmless");
delay(5000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment