Comments (11)
Hi @deladriere ,
Unfortunately I don't any SAMD board by hand. And I'm not sure what compiler definition to use for these boards. So, I fixed compilation for SAMD by adding defined(ARDUINO_ARCH_SAMD)
blocks.
Download latest master branch and let me know if it works for. Please, be careful, since I didn't publish new release yet. You need to get latest source of ssd1306 library and put them to libraries folder of Arduino IDE.
from ssd1306.
It works ! thanks a lot
(now I will compare its speed performance compared to the Adafruit ssd1306 library)
from ssd1306.
Take into account, that Adafruit library always uses buffered output. While ssd1306 library's main mode is direct writing to LCD display. That is, if you need to draw single pixel on the display, the following actions will take place:
Adafruit
- draw pixel in buffer (for example 128x64 LCD)
- send buffer to LCD (this will require sending of 1024 bytes over i2c)
ssd1306
- draw pixel directly to LCD by sending several bytes to LCD
So, the performance greatly depends on what you need to do in your project.
Of course, ssd1306 library also has some support of buffered output (see NanoCanvas) and some another kind of fast buffers: SpritePool (see loderunner and snowflakes examples).
from ssd1306.
Thank you so much for your help 👍
What I want to do is "just" write 3 lines of large text and refresh them at high speed to avoid slowing down my main code (a kind of musical instrument, where tempo is critical)
I wrote a test code to compare the 2 libraries :
I am pushing the I2C clock to the max but it still needs 23 ms to redraw the screen.
(here is the code I use lexus2K SSD1306 I2C text speed test
The Adafruit code does a little better with 20 ms and no flicker
(here is the code I use Adafruit SSD1306 I2C text speed test
Any suggestions welcome!
from ssd1306.
In the I2C text speed test you wrongly set i2c clock to 2500000:
long I2C_clock=2500000;
...
Wire.setClock(I2C_clock);
while in Adafruit text speed i2c speed is set it to 250kHz.
Remember that ssd1306 controller supports max 400kHz.
from ssd1306.
Ok I will check with an oscilloscope because my sketch works fine until 2700000 before crashing
from ssd1306.
Hi @deladriere,
I reviewed your tests. You cannot compare too libraries via tests, performing different operations.
Your Adafruit test does all operations in memory and then just draws buffer on the screen (sending 1024 bytes via display.display()
), while your ssd1306 test doesn't use any buffer: clears controller memory directly over i2c (1024 bytes), and then prints all text again over i2c. Remember that i2c operations are always very slow comparing to SRAM operations. Thus in your tests ssd1306 library does much more work over i2c.
Adafruit library cannot do any graphics directly to OLED without using any memory buffer. So, to do similar tests, you need to use NanoCanvas.
Here is the test, I developed for Adafruit and ssd1306 library (it uses buffer for both cases): speedtest.ino (comment/uncomment #define ADAFRUIT_TEST
).
For both libraries I get 47ms results
But with ssd1306 library you can work with LCD without buffer, reducing SRAM memory consumption.
Also, be careful with the speed: ssd1306 datasheet from manufacturer says "i2c Clock Cycle Time min 2.5us", that means that in i2c mode ssd1306 LCD cannot work faster than 1/2.5us = 400kHz. So, refer to i2c timing characteristics for your LCD device.
from ssd1306.
Thanks !
I have 38 ms with your library but 122 ms with the Adafruit !
I would like to adapt your code to use the bigger fonts like charF12x16 to see if the speed is still good.
How can I do that ?
from ssd1306.
Please, check commit 9dd141a. I added charF12x16 to NanoCanvas, but didn't check.
from ssd1306.
charF12x16 fonts work, thanks !
from ssd1306.
You're welcome.
I'm closing the issue since SAMD platform is fixed
from ssd1306.
Related Issues (20)
- Working on a IP Camera - Anyka HOT 2
- pgmspace.h issue since 1.8.3 HOT 5
- ssd1306_setRotation
- How to use this in Linux running non single board computer (laptop's i2c port) HOT 1
- Apparent hang in AVR TWI communications when display absent
- nano_gfx_types.h defines macros which pollutes the global namespace and cause compile errors
- Add support for recent series of attiny MCUs HOT 2
- Support Pi Pico / RP2040 Microcontrollers HOT 3
- I2C definition for ESP32 Espressif HOT 3
- How to port it to ESP IDF HOT 1
- Minor edits needed for Teensy HOT 4
- Potential Conflict AHTX10/AHT10 and LCDGFX HOT 2
- "Failed to Initialize: No such file or directory!" on RPI zero 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux HOT 1
- Print text at any Y-value? HOT 1
- Larger fonts possible? Turn off/on display? HOT 2
- Error compiling ssd1306_demo HOT 3
- how to convert custom fonts ? HOT 1
- How to specify i2c bus on linux? HOT 1
- None of examples load on attiny44 HOT 4
- ssd1306_demo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssd1306.