Skip to content

Commit d1afac2

Browse files
committed
Adding display firmware example. Updating keywords.
1 parent 93fb813 commit d1afac2

File tree

2 files changed

+59
-13
lines changed

2 files changed

+59
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
SerLCD Library - Show the firmware version
3+
Gaston Williams - August 29, 2018
4+
5+
This sketch prints the device's firmware version to the screen.
6+
7+
The circuit:
8+
SparkFun RGB OpenLCD Serial display connected through
9+
a Sparkfun Qwiic adpater to an Ardruino with a
10+
Qwiic shield or a Sparkfun Blackboard with Qwiic built in.
11+
12+
The Qwiic adapter should be attached to the display as follows:
13+
Display / Qwiic Cable Color
14+
GND / Black
15+
RAW / Red
16+
SDA / Blue
17+
SCL / Yellow
18+
19+
Note: If you connect directly to a 5V Arduino instead, you *MUST* use
20+
a level-shifter to convert the i2c voltage levels down to 3.3V for the display.
21+
22+
This code is based on the LiquidCrystal code originally by David A. Mellis
23+
and the OpenLCD code by Nathan Seidle at SparkFun.
24+
25+
License: This example code is in the public domain.
26+
*/
27+
28+
#include <Wire.h>
29+
30+
#include <SerLCD.h> //Click here to get the library: http://librarymanager/All#SparkFun_SerLCD
31+
SerLCD lcd; // Initialize the library with default I2C address 0x72
32+
33+
void setup() {
34+
Wire.begin();
35+
36+
lcd.begin(Wire); //Set up the LCD for I2C
37+
}
38+
39+
void loop() {
40+
lcd.command(','); //Send the comma to display the firmware version
41+
//Firmware will be displayed for 500ms so keep re-printing it
42+
delay(500);
43+
}
44+

keywords.txt

+15-13
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,31 @@ SerLCD KEYWORD1
1515
begin KEYWORD2
1616
clear KEYWORD2
1717
home KEYWORD2
18-
print KEYWORD2
19-
write KEYWORD2
2018
setCursor KEYWORD2
21-
cursor KEYWORD2
19+
createChar KEYWORD2
20+
writeChar KEYWORD2
21+
write KEYWORD2
22+
noDisplay KEYWORD2
23+
display KEYWORD2
2224
noCursor KEYWORD2
23-
blink KEYWORD2
25+
cursor KEYWORD2
2426
noBlink KEYWORD2
25-
display KEYWORD2
26-
noDisplay KEYWORD2
27-
autoscroll KEYWORD2
28-
noAutoscroll KEYWORD2
29-
leftToRight KEYWORD2
30-
rightToLeft KEYWORD2
27+
blink KEYWORD2
3128
scrollDisplayLeft KEYWORD2
3229
scrollDisplayRight KEYWORD2
33-
createChar KEYWORD2
34-
writeChar KEYWORD2
3530
moveCursorLeft KEYWORD2
3631
moveCursorRight KEYWORD2
3732
setBacklight KEYWORD2
3833
setFastBacklight KEYWORD2
34+
leftToRight KEYWORD2
35+
rightToLeft KEYWORD2
36+
autoscroll KEYWORD2
37+
noAutoscroll KEYWORD2
38+
setContrast KEYWORD2
39+
setAddress KEYWORD2
40+
command KEYWORD2
41+
specialCommand KEYWORD2
3942

4043
#######################################
4144
# Constants (LITERAL1)
4245
#######################################
43-

0 commit comments

Comments
 (0)