Letters on a Seven Segment Display

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jamesmunroe
 
Posts: 20
Joined: Sat Sep 07, 2013 1:13 pm

Letters on a Seven Segment Display

Post by jamesmunroe »

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- ... t-backpack)

User avatar
adafruit_support_bill
 
Posts: 88601
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

Post by adafruit_support_bill »

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

writeDigitRaw(0,B00000001);
To turn on segments C, G, E and F (to make an 'h') you would call:

Code: Select all

writeDigitRaw(0,B01110100);

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

Re: Letters on a Seven Segment Display

Post by jamesmunroe »

Thanks for the help!

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

Code: Select all

writeDigitRaw(0,B001010000);
I'm assuming that the first 0 of the mask just isn't used since there are only 7 segments?

User avatar
adafruit_support_bill
 
Posts: 88601
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

Post by adafruit_support_bill »

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

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

Re: Letters on a Seven Segment Display

Post by andywb »

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?

User avatar
adafruit_support_bill
 
Posts: 88601
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

Post by adafruit_support_bill »

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

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

Re: Letters on a Seven Segment Display

Post by Themys »

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

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

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

User avatar
adafruit_support_bill
 
Posts: 88601
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

Post by adafruit_support_bill »

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.

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

Re: Letters on a Seven Segment Display

Post by Themys »

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

User avatar
adafruit_support_bill
 
Posts: 88601
Joined: Sat Feb 07, 2009 10:11 am

Re: Letters on a Seven Segment Display

Post by adafruit_support_bill »

No. Not for raw bit patterns.

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

Re: Letters on a Seven Segment Display

Post by Themys »

OK, Thanks

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”