Re: SSD1306 OLED (42x40) I2C display from scratch
Basically the display is 360 bytes of ram where every bit is a oled, the ram is divided into 5 pages each of 72 bytes
the 5 pages are overlaid onto a larger array that is 8 pages of 128 bytes, precisely where is not known to me [i have never seen one of those modules]
the ssd1306 is very versatile and allows vertical and horiz offsets to be set along with scan direction and various mem access methods to suit you.
to write to a byte you must address its x and y position , the width to be written and number of pages is also expected to be set
ie to write a 10x14 chr 14 high 10 wide at page 1 posn 12
SET_XY:
COM = $21 : GOSUB SEND_COMMAND
COM = 12 : GOSUB SEND_COMMAND ;x=12
COM = 22 : GOSUB SEND_COMMAND ;12+10
COM = $22 : GOSUB SEND_COMMAND
COM = 1 : GOSUB SEND_COMMAND ;y=1
COM = 2 : GOSUB SEND_COMMAND ;1+1
RETURN
then send the 20 bytes needed to represent your chr
In my case, I will use this LCD to display, as big as possible, a number as a percentage (0.0%...99.9%).
easy you need to create a big font with the chrs you need in it
Is there a way to send "text" to the display like common LCDs?
no not even close
if you want easy use a pic18 and my code from here
where you can define the screen size and create fonts as you need
or use an enhanced core pic16 and my earlier code that can do double size chrs
Last edited by richard; - 20th November 2023 at 09:28.
Warning I'm not a teacher
Bookmarks