Skip to content

Commit 0227dd8

Browse files
authored
Merge pull request #5 from fourstix/master
Enahancement: As a user user I need to change the segment mapping for an existing character
2 parents 128dc81 + 453f68a commit 0227dd8

File tree

5 files changed

+292
-123
lines changed

5 files changed

+292
-123
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**************************************************************************************
2+
* This example redefines some characters of an alphanumeric display.
3+
*
4+
* Written by Gaston Williams
5+
* April 30, 2020
6+
*
7+
* Based on code written by
8+
* Priyanka Makin @ SparkFun Electronics
9+
* Original Creation Date: February 26, 2020
10+
*
11+
* SparkFun labored with love to create this code. Feel like supporting open source hardware?
12+
* Buy a board from SparkFun! https://www.sparkfun.com/products/16426
13+
*
14+
* This code is beerware; if you see me (or any other SparkFun employee) at the
15+
* local, and you've found our code helpful, please buy us a round!
16+
*
17+
* Hardware Connections:
18+
* Attach Red Board to computer using micro-B USB cable.
19+
* Attach Qwiic Alphanumeric board to Red Board using Qwiic cable.
20+
* Don't close any of the address jumpers so that it defaults to address 0x70.
21+
*
22+
* Distributed as-is; no warranty is given.
23+
*****************************************************************************************/
24+
#include <SparkFun_Alphanumeric_Display.h>
25+
HT16K33 display;
26+
27+
void setup() {
28+
Serial.begin(115200);
29+
Serial.println("Qwiic Alphanumeric examples");
30+
Wire.begin(); //Join I2C bus
31+
32+
//check if display will acknowledge
33+
if (display.begin() == false)
34+
{
35+
Serial.println("Device did not acknowledge! Freezing.");
36+
while(1);
37+
}
38+
Serial.println("Display acknowledged.");
39+
40+
//Just for demo purposes, show original characters before change
41+
display.print("cafe");
42+
delay(500);
43+
display.print("size");
44+
45+
46+
//Update a, e, f, s and z to new characters
47+
//This change is not permanent, and lasts only for this program.
48+
49+
//Define 14 segment bits: nmlkjihgfedcba
50+
display.defineChar('a', 0b01000001011000);
51+
display.defineChar('e', 0b10000001011000);
52+
display.defineChar('f', 0b01010101000000);
53+
//Also can use constants SEG_A - SEG_N to define characters
54+
display.defineChar('s', SEG_L | SEG_I | SEG_D); // 0b00100100001000
55+
display.defineChar('z', SEG_N | SEG_G | SEG_D); // 0b10000001001000
56+
}
57+
58+
void loop()
59+
{
60+
//Show the new characters
61+
delay(500);
62+
display.print("cafe");
63+
delay(500);
64+
display.print("size");
65+
}

examples/Example7_unkownChar/Example7_unkownChar.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*
44
* Priyanka Makin @ SparkFun Electronics
55
* Original Creation Date: March 13, 2020
6+
* Updated April 30, 2020 by Gaston Williams - changed exclamation to tab character
67
*
78
* SparkFun labored with love to create this code. Feel like supporting open source hardware?
89
* Buy a board from SparkFun! https://www.sparkfun.com/products/16391
@@ -34,7 +35,7 @@ void setup() {
3435
}
3536
Serial.println("Display acknowledged.");
3637

37-
display.print("!!!!");
38+
display.print("\t\t\t\t"); //tabs are not printable characters
3839
}
3940

4041
void loop()

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun Qwiic Alphanumeric Display Arduino Library
2-
version=v1.0.1
2+
version=v1.1.1
33
author=SparkFun Electronics
44
maintainer=SparkFun Electronics
55
sentence=A library to drive the Holtek HT16K33 LED Driver with an Alphanumeric Display.

0 commit comments

Comments
 (0)