Led matrix with HT1632C controller (3)

by luca
11 comments

In this post, I’m going to show how to display some characters on your display…

ENCODING

If you give a look to the display’s datasheet, you figure out how leds are mapped to memory cells, starting from the top left corner:

Take a squared sheet and write the text, keeping in mind that char’s height is 8 squares and that you can use a maximum of 32 columns:

Every black square corresponds to a bit 1; every while square corresponds to a bit 0.

Write down the bits, reading them as the arrow indicates and using B as a prefix to tell Arduino’s IDE they are binary values:

PROGMEM

Arduino has a very limited RAM capacity (2KB): to store a big amount of data you can use the program memory (32KB in Arduino Uno) with the keyword PROGMEM:

You need to use some particular methods (defined in pgmspace.h) to read data saved in program memory; I’m going to use pgm_read_byte():

SKETCH

The complete sketch is available in my Github’s repository.

It’s very simple:

[checklist]

  • it saves in PROGMEM the text to display (text[])
  • initializes the display
  • sends the text (24 columns) reading byte per byte the text[] array
  • sends 8 columns (64bits) of zeroes to address all the 32 columns of the display

[/checklist]

Here’s some screenshots:

Related Posts

11 comments

Locomolo Wednesday October 10th, 2012 - 11:36 PM

Hi!

Is it posible to scroll a simple text?

Is there any library dispo?

Thanks!!

Reply
luca Thursday October 11th, 2012 - 08:12 AM

Hello! I’m working on a scroll tutorial, it should be ready in a week. A library will follow!
Thanks

Reply
Locomolo Thursday October 11th, 2012 - 08:16 PM

Great!!!!! good work!

I will follow your project

Reply
lucadentella.it – Matrice di led con HT1632C (4) Friday October 12th, 2012 - 10:12 PM

[…] precedente tutorial, abbiamo visto come visualizzare sul display una scritta statica, codificata e memorizzata nella […]

Reply
Kevin Wednesday November 11th, 2015 - 09:31 PM

Hi Luca,

How can I expand the display so it won’t cut off at the 24th column? I would like to use the whole 32 columns to display texts.

Thanks

Reply
luca Wednesday November 11th, 2015 - 09:54 PM

Hi Kevin, this is strange… everywhere in my code the buffer, the loops… are from 0 to 31 columns to use the full display… maybe an electrical problem?

Reply
Kevin Wednesday November 11th, 2015 - 11:37 PM

Hi Luca

I will take a deeper look at it, but when i run the Rolling example, i can see the dot going all the way down to the end. I’ll let you know 🙂

Anyways I am wonder if there is a way to shut down the LED even when there is power floating.

Reply
torquaro Saturday April 9th, 2016 - 04:07 PM

non riesco a programmare la matrice led su un arduino compaibile WeMos D1 R2.
Ne sapete qualcosa ??????

Reply
torquato Saturday April 9th, 2016 - 04:09 PM

con arduino uno funziona tutto. Volevo sincronizzare ds1307 con NTP

Reply
m.franco Saturday March 10th, 2018 - 04:25 PM

buon giorno Luca, le chiedo cosa modificare negli esempi per utilizzare un HT1632c con 16 righe x 24 colonne. grazie

Reply
luca Monday March 12th, 2018 - 09:14 AM

Salve, il controller non “conosce” il layout del display… un display 16×24 è “semplicemente” mappato in memoria come 384 celle diverse. La prima cosa da capire è come sono organizzate queste celle (per righe? per colonne?), ad esempio provando il mio sketch “rolling” mettendo for(int i = 0; i < 384; i++) {

Reply

Leave a Comment

11 + 13 =