public
Last active

A simple Arduino script to display the Sparkfun logo and SparkFun!! on a HD44780 LCD screen. See https://lh6.googleusercontent.com/_L0Eke9UQNQJukJq1SFx7ZevKHVCGhQ6FiI92qOs1yMNd-CIVs9OLxAx1cneC-sp1g=s400 for a picture

  • Download Gist
SparkfunChar.ino
Arduino
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
/*
The Sparkfun logo is intellectual property of Sparkfun Inc.
 
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K potentiometer:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
* 10K poterntiometer on pin A0
*/
 
// include the library code:
#include <LiquidCrystal.h>
 
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
 
// make some custom characters:
byte sfe1[] = {0x01,0x03,0x03,0x01,0x04,0x08,0x1D,0x1F};
byte sfe2[] = {0x18,0x14,0x10,0x1A,0x1E,0x1F,0x1F,0x1F};
byte sfe3[] = {0x1F,0x1F,0x1F,0x1F,0x1F,0x1C,0x18,0x10};
byte sfe4[] = {0x1F,0x1E,0x1E,0x1C,0x10,0x00,0x00,0x00};
 
 
void setup() {
// create a new character
lcd.createChar(0, sfe1);
// create a new character
lcd.createChar(1, sfe2);
// create a new character
lcd.createChar(2, sfe3);
// create a new character
lcd.createChar(3, sfe4);
 
// set up the lcd's number of columns and rows:
lcd.begin(8, 2);
lcd.write(byte(0));
lcd.write(byte(1));
lcd.print(" Spark");
lcd.setCursor(0,1);
lcd.write(byte(2));
lcd.write(byte(3));
lcd.print(" Fun!!");
}
 
void loop() {
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.