Code Monkey home page Code Monkey logo

Comments (8)

TroyFletcher avatar TroyFletcher commented on August 15, 2024 3

Hey Jack,

I ran into this same problem, and found this solution https://github.com/greiman/SSD1306Ascii It's very light weight but drops some features for it. Good luck!

from adafruit_ssd1306.

slomobile avatar slomobile commented on August 15, 2024

If you have a 128x64 display, each pixel needs 1 bit in RAM to represent whether you want it on or off. There is no way around this. 8192 bits, or 1024 bytes of RAM are required in the form of a buffer, namely; static uint8_t buffer[SSD1306_LCDHEIGHT * SSD1306_LCDWIDTH / 8]
A few more bytes are required for various settings and housekeeping but this buffer represents the bulk of it. Using a smaller number of pixels such as 128x32 reduces the buffer size. But, depending on what your project needs to do, you might try to reuse that buffer for other purposes when it is not actively being used by the SSD1306 library. As I understand it, the buffer is only accessed while laying out the screen and during calls to display.display(). If you write your sketch so that everything that goes onscreen is generated at the beginning of loop() followed by display.display(),of loop(), then for the rest of loop(), buffer and its 1024 bytes will be at your disposal.
I have not tried this, so cannot confirm that it works

from adafruit_ssd1306.

geetee24 avatar geetee24 commented on August 15, 2024

thank you - however when I compile my code with your library - at compile time your library needs 1024 bytes hence it is greater than the 2k bytes of ram that my arduino has (my other code uses 1.2 k).

Why does your code need this RAM at comlpile time?

from adafruit_ssd1306.

shulter avatar shulter commented on August 15, 2024

1024 bytes do fit into 2k bytes of RAM, please post your compile log @geetee24

from adafruit_ssd1306.

AlexSneedMiller avatar AlexSneedMiller commented on August 15, 2024

Would it be possible to take that big static array away by moving it into some sort of loop that iterates over each pixel (or at least each 8 pixels) rather than taking up that much memory to begin with? I haven't had time to dive deep into the library to look into this yet.

I think this would be similar to what was described before by using that memory when it's not being used, but this approach would ensure that doesn't happen.

from adafruit_ssd1306.

ladyada avatar ladyada commented on August 15, 2024

you can't read data from the display so we have to buffer the entire thing. no fix possible - its just how this chip works! :)

from adafruit_ssd1306.

TinMen1011 avatar TinMen1011 commented on August 15, 2024

I'm trying to accomplish a very simple task. (I know they all say that) I'm using an Arduino Uno R3, RF69 Radio RX and a OLED (Adafruit_SSD1306 display(OLED_RESET)) display. I want to display two pieces of information send from another Arduino radio onto the OLED. That's it... It turns out that that would take 102% of memory. It doesn't look possible to use these in combination. I see that the OLED is a hog, 74% of memory. Can you recommend any work arounds such as a Arduino Mega or another display device that uses less memory and is good looking? I'm using it in my RV displaying Temperature and voltage at the drivers position transmitted from an equipment cabinet.

Thanks
Jack

from adafruit_ssd1306.

Kolynskij avatar Kolynskij commented on August 15, 2024

Hi Jack
Late reply, but I just started looking at Arduino and OLED. The U8GLIB library seems to offer more control of the amount of resources used. You can tell it to use 1 page for buffering, 2 pages or Full buffering. At 1 page, instead of 70-80% utilisation, it uses about 20%. Much more reasonable.
As a con, the drawing is lamentably slow, and the library isn't as easy to use as the adafruit. Especially the u8G2 library, which I can't get to work properly.
For slow graphics apps, the U8GLIB is a good option.

from adafruit_ssd1306.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.