Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions examples/Example10_DefineChar/Example10_DefineChar.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**************************************************************************************
* This example redefines some characters of an alphanumeric display.
*
* Written by Gaston Williams
* April 30, 2020
*
* Based on code written by
* Priyanka Makin @ SparkFun Electronics
* Original Creation Date: February 26, 2020
*
* SparkFun labored with love to create this code. Feel like supporting open source hardware?
* Buy a board from SparkFun! https://www.sparkfun.com/products/16426
*
* This code is beerware; if you see me (or any other SparkFun employee) at the
* local, and you've found our code helpful, please buy us a round!
*
* Hardware Connections:
* Attach Red Board to computer using micro-B USB cable.
* Attach Qwiic Alphanumeric board to Red Board using Qwiic cable.
* Don't close any of the address jumpers so that it defaults to address 0x70.
*
* Distributed as-is; no warranty is given.
*****************************************************************************************/
#include <SparkFun_Alphanumeric_Display.h>
HT16K33 display;

void setup() {
Serial.begin(115200);
Serial.println("Qwiic Alphanumeric examples");
Wire.begin(); //Join I2C bus

//check if display will acknowledge
if (display.begin() == false)
{
Serial.println("Device did not acknowledge! Freezing.");
while(1);
}
Serial.println("Display acknowledged.");

//Just for demo purposes, show original characters before change
display.print("cafe");
delay(500);
display.print("size");


//Update a, e, f, s and z to new characters
//This change is not permanent, and lasts only for this program.

//Define 14 segment bits: nmlkjihgfedcba
display.defineChar('a', 0b01000001011000);
display.defineChar('e', 0b10000001011000);
display.defineChar('f', 0b01010101000000);
//Also can use constants SEG_A - SEG_N to define characters
display.defineChar('s', SEG_L | SEG_I | SEG_D); // 0b00100100001000
display.defineChar('z', SEG_N | SEG_G | SEG_D); // 0b10000001001000
}

void loop()
{
//Show the new characters
delay(500);
display.print("cafe");
delay(500);
display.print("size");
}
3 changes: 2 additions & 1 deletion examples/Example7_unkownChar/Example7_unkownChar.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* Priyanka Makin @ SparkFun Electronics
* Original Creation Date: March 13, 2020
* Updated April 30, 2020 by Gaston Williams - changed exclamation to tab character
*
* SparkFun labored with love to create this code. Feel like supporting open source hardware?
* Buy a board from SparkFun! https://www.sparkfun.com/products/16391
Expand Down Expand Up @@ -34,7 +35,7 @@ void setup() {
}
Serial.println("Display acknowledged.");

display.print("!!!!");
display.print("\t\t\t\t"); //tabs are not printable characters
}

void loop()
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun Qwiic Alphanumeric Display Arduino Library
version=v1.0.1
version=v1.1.1
author=SparkFun Electronics
maintainer=SparkFun Electronics
sentence=A library to drive the Holtek HT16K33 LED Driver with an Alphanumeric Display.
Expand Down
Loading