Display big characters on ssd1306

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everyone. I'm trying to make the ssd1306 128x64 display work with i2c and display big size characters.

I am using an atmega 328p.

I've found this code that seem to be fine but it doesn't display anything on the display:  https://github.com/Sylaina/oled-display

What is wrong and why doesn't the code work?

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I strongly recommend that you use Arduino code.   It will run directly on your ATmega328P.

 

There are several Arduino libraries for the SSD1306.

Arduino libraries come with EXAMPLES.

 

So you can install a library via the IDE LIbrary Manager.   Run all of the Library examples.    They should run straight out of the box.

Most libraries can use extra fonts.

 

If you want help with the GitHub code that you have found,   post your code either by pasting to the message or by Zipping up your AS7.0 project and attaching the ZIP file.

 

Then readers might help to debug your code.

 

It "looks" as if there is a standard 7x5 font.   And you can display in x1, x2, x3, ... sizes.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know there are several examples for arduino and I already tried them but for project requirement I need the code in C.
I will post my code later but it is the same of that in the github link.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes,  I created an AS7.0 project from the GitHub code.    And both examples work.

 

However,  you need to configure a few things e.g.

Project Symbols: F_CPU=1600000

 

lcd.h: 

#define I2C			// I2C or SPI
    /* TODO: define displaycontroller */
//#define SH1106                 // or SSD1306, check datasheet of your display
#define SSD1306                 // or SSD1306, check datasheet of your display
    /* TODO: define displaymode */
//#define TEXTMODE                // TEXTMODE for only text to display,
#define GRAPHICMODE for text and graphic
    /* TODO: define font */
#define FONT            ssd1306oled_font// set font here, refer font-name at font.h/font.c

    /* TODO: define I2C-adress for display */

    // using 7-bit-adress for lcd-library
    // if you use your own library for twi check I2C-adress-handle
#define LCD_I2C_ADR         (0x78 >> 1)    // 7 bit slave-adress without r/w-bit
    // r/w-bit are set/unset by library
    // e.g. 8 bit slave-adress:
    // 0x78 = adress 0x3C with cleared r/w-bit (write-mode)

David.

Attachment(s): 

Last Edited: Thu. Jan 16, 2020 - 10:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've already defined the F_CPU and I can compile the program but when it put it on the board it doesn't show anything. So that is not the problem

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nico444 wrote:
but when it put it on the board it doesn't show anything. So that is not the problem
Have you had *any* SSD1306 code work with your display? IOW is it just a problem with this specific Github project or could it simply be a more fundamental wiring issue?

several examples for arduino and I already tried them 

So did those work? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes the arduino codes worked.

I finally make the c code work on my display using the david's file. I can now display characters with normal and big size.

 

You said that I can display in x1, x2, x3, ... sizes but I see that there are only two sizes, the normal one and the big one. Is it possible to further increase the size?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nico444 wrote:
You said that I can display in x1, x2, x3, ... sizes but I see that there are only two sizes

current font x1 = 5x7      1 dot = 1 dot

current font x2 = 10x14  1 dot = 2 high/2wide dots

current font x3 = 15x21  1 dot = 3 high/3wide dots

you just "scale" each character to a larger size

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Fri. Jan 17, 2020 - 08:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My apologies.   I just assumed it would do more than x1 and x2.

 

I tried lcd_charMode(3); and it just displayed in x1.

 

If you really want bigger than x2 it would mean changing the library file.

 

Arduino libraries handle fonts and sizes.

 

I can't see much point in text x3.    If you just want big digits,   say so.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No problem, that's okay.
Thank you very much