0

Letters on a Seven Segment Display
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Letters on a Seven Segment Display

by jamesmunroe on Sat Nov 02, 2013 10:34 am

I've looked all over the adafruit and arduino websites and beyond but I haven't been able to find the answer to this question:

How do I write letters (for instance 'rh') on a seven segment display with I2C backpack (http://www.adafru.it/1002).

One of the Adafruit tutorials mentions being able to draw a raw 8-bit mask using writeDigitRaw(location,bitmask), but I have no idea what that means or how to use it.

Could somebody shed a little light on this? Is there an alphabet of sorts, pre-translated into 8-bit masks for use with a seven segment display/I2C backpack and Adafruit's LEDbackpack code?

Thanks!

(tutorial that mentions it: http://learn.adafruit.com/adafruit-led-backpack/0-dot-56-seven-segment-backpack)

jamesmunroe
 
Posts: 20
Joined: Sat Sep 07, 2013 1:13 pm

Re: Letters on a Seven Segment Display

by adafruit_support_bill on Sat Nov 02, 2013 11:06 am

If you look at page 3 of the data sheet for the display: http://www.adafruit.com/datasheets/BL-Q56C-43.pdf
You will see that the segments are labeled A-G. These correspond to bits in the bitmask, starting with A as the low-order bit.

Bitmasks can be specified as 8-bit binary numbers using the "B" notation. To turn on segment A (the top segment) in the first position, you would call
Code: Select all | TOGGLE FULL SIZE
writeDigitRaw(0,B00000001);

To turn on segments C, G, E and F (to make an 'h') you would call:
Code: Select all | TOGGLE FULL SIZE
writeDigitRaw(0,B01110100);

adafruit_support_bill
 
Posts: 75758
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

by jamesmunroe on Sat Nov 02, 2013 1:00 pm

Thanks for the help!

So, would a lowercase 'r' would look like this?

Code: Select all | TOGGLE FULL SIZE
writeDigitRaw(0,B001010000);


I'm assuming that the first 0 of the mask just isn't used since there are only 7 segments?

jamesmunroe
 
Posts: 20
Joined: Sat Sep 07, 2013 1:13 pm

Re: Letters on a Seven Segment Display

by adafruit_support_bill on Sat Nov 02, 2013 3:37 pm

That looks right. From the data sheet, it looks like the 8'th bit is the decimal point next to the digit.

adafruit_support_bill
 
Posts: 75758
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

by andywb on Wed Nov 22, 2017 3:08 am

This is really useful. Is there a list of all the command codes for the 1.2 inch backpack display as I am trying to use this with a very simple parallax controller and need to output the native command codes?

andywb
 
Posts: 1
Joined: Wed Nov 22, 2017 3:04 am

Re: Letters on a Seven Segment Display

by adafruit_support_bill on Wed Nov 22, 2017 7:14 am

The backpacks are all based on the HT16K33 chip. The control and data registers for the chip are all defined in the data sheet: https://cdn-shop.adafruit.com/datasheet ... 33v110.pdf

The specific i2c command sequences used to drive the 1.2" seven segment backpack can be seen in the "Adafruit_7segment " class of the library:
https://github.com/adafruit/Adafruit_LED_Backpack

adafruit_support_bill
 
Posts: 75758
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

by Themys on Mon Apr 02, 2018 9:14 am

Hello,

I trying to send a word to the 7 segments 1.2".
I manage to display a letters one by one and together ( 1 line of code by letter), that's ok.

Code: Select all | TOGGLE FULL SIZE
matrix.begin(0x70);
   matrix.setBrightness (15);
   matrix.writeDigitRaw (0,B01110011); //P
   matrix.writeDigitRaw (1,B00111000); //l
   matrix.writeDigitRaw (3,B01110111); //A
   matrix.writeDigitRaw (4,B01101110); //y
   matrix.writeDisplay();


but, I can't put together all letter on one line of code. I try with that but it doesn't work:

Code: Select all | TOGGLE FULL SIZE
uint8_t PlAy[]={B01110011, B00111000, B01110111, B01101110};
void setup()
{
   matrix.begin(0x70);
   matrix.setBrightness (15);
        matrix.writeDigitRaw (0,PlAy);
        matrix.writeDisplay();


and with matrix.write function it doesn't work too

I need your help
thanks

Themys
 
Posts: 3
Joined: Mon Apr 02, 2018 8:55 am

Re: Letters on a Seven Segment Display

by adafruit_support_bill on Mon Apr 02, 2018 9:25 am

As the name implies, WriteDigitRaw writes raw bit patterns to a single digit position. To write to multiple digit positions, you need to do them one-by-one.

adafruit_support_bill
 
Posts: 75758
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

by Themys on Mon Apr 02, 2018 9:30 am

ok, there is no function to write to multiple digit position in one line ?

Themys
 
Posts: 3
Joined: Mon Apr 02, 2018 8:55 am

Re: Letters on a Seven Segment Display

by adafruit_support_bill on Mon Apr 02, 2018 9:40 am

No. Not for raw bit patterns.

adafruit_support_bill
 
Posts: 75758
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

by Themys on Mon Apr 02, 2018 9:52 am

OK, Thanks

Themys
 
Posts: 3
Joined: Mon Apr 02, 2018 8:55 am

Please be positive and constructive with your questions and comments.