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:
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:
Hi!
Is it posible to scroll a simple text?
Is there any library dispo?
Thanks!!
Hello! I’m working on a scroll tutorial, it should be ready in a week. A library will follow!
Thanks
Great!!!!! good work!
I will follow your project
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
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?
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.
non riesco a programmare la matrice led su un arduino compaibile WeMos D1 R2.
Ne sapete qualcosa ??????
con arduino uno funziona tutto. Volevo sincronizzare ds1307 con NTP
buon giorno Luca, le chiedo cosa modificare negli esempi per utilizzare un HT1632c con 16 righe x 24 colonne. grazie
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++) {