Now that I have all digits,dots and colons working properly, I thought I would experiment with printing some characters on the 7-segment display. I see there are two functions for printing char and unsigned char but I cannot seem to understand how to use them. I am also confused about the int= part (ex. matrix.print(char, int=0)). After experimenting with different hex values, I was able to print "Ohio" using the following code:
matrix.clear();
matrix.writeDigitRaw(0,0x3F); //O
matrix.writeDigitRaw(1,0x74); //h
matrix.writeDigitRaw(3,0x04); //i
matrix.writeDigitRaw(4,0x5C); //o
matrix.writeDisplay();
There must be a better way! If there is, can you point me to a simple example? If there is not, could you point me to a list that would map all alpha characters to an equivalent hex value for use on a seven segment display?
Thanks!
Chris
1.2" 7-segment backpack -- characters
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 466
- Joined: Thu Aug 30, 2012 1:34 am
Re: 1.2" 7-segment backpack -- characters
well, i couldn't find codes for characters in the first few search engine results, so i'll just describe how to invent your own.
values for the segments are :
1 = top
2 = upper left
4 = lower left
8 = bottom
16 = lower left
32 = upper left
64 = middle
pick the segments you want and add up the numbers. for instance
A = 1 + 2 + 4 +16 + 32 + 64 = 119 = 0x77
P = 1 + 2 + 16 + 32 + 64 =114 = 0x73
o = 4 + 8 + 16 + 64 = 92 = 0x5c
good luck with "z."
values for the segments are :
1 = top
2 = upper left
4 = lower left
8 = bottom
16 = lower left
32 = upper left
64 = middle
pick the segments you want and add up the numbers. for instance
A = 1 + 2 + 4 +16 + 32 + 64 = 119 = 0x77
P = 1 + 2 + 16 + 32 + 64 =114 = 0x73
o = 4 + 8 + 16 + 64 = 92 = 0x5c
good luck with "z."
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: 1.2" 7-segment backpack -- characters
A single 7-segment display doesn't have enough resolution to display the whole alphabet without ambiguity. Wikipedia has a list of general options though: http://en.wikipedia.org/wiki/Seven-segm ... sentations
Please be positive and constructive with your questions and comments.