- Name : SSD1306_OLED
- Description :
- Library to support the I2C 128X64 OLED Display Module driven by the SSD1306 controller for Linux based SBC.
- Dynamic install-able system level C++ library.
- Inverse color, rotate, sleep, scroll and contrast control.
- Bitmaps supported.
- Hardware I2C
- Also tested on 128X32 display size. Should work for 96X16 display size.
Manufacturers diagram showing connections.
Example files
Filepath | File Function | Screen Size |
---|---|---|
HELLO_WORLD | Basic use case | 128x64 |
BITMAP | Shows use of bitmaps | 128x64 |
CLOCK_DEMO | A basic clock Demo | 128x64 |
SPEED_TEST | Frame rate per second test | 128x64 |
TEXT_GRAPHICS_FUNCTIONS | Tests Text,graphics and functions | 128x64 |
Hardware I2C.
- I2C Address is set by default to 0x3C(your module could be different, user can change argument passed into OLED class constructor). OLED_I2C_FLAGS No flags are currently defined. This parameter should be set to zero. The value to set OLED_I2C_DEVICE , can be found by running command, to view available I2C device numbers
i2cdetect -l
- I2C Clock rate is set by device installed on. During development and testing on raspberry pi 5 it was found that by default the baudrate was set to 100,000 baud. By modifying the file /boot/firmware/config.txt baud can be increased
param=i2c_arm=on,i2c_arm_baudrate=400000
- In the event of an error writing a byte, debug info with error code will be written to console. Debug flag must be set to true to see this output. User can set error timeout between retry attempts and number of retry attempts and can monitor the Error flag.
Different bitmaps methods can be used.
num | Method name | data addressing | Notes |
---|---|---|---|
1 | drawBitmap() | Vertical | default, setDrawBitmapAddr(true) |
2 | drawBitmap() | Horizontal | setDrawBitmapAddr(false) |
Bitmaps can be turned to data here at link See example file "BITMAP" for more details.
- To test on a different size of display edit the my_OLED_width & my_OLED_height variables in examples files.
Display size | Supported | Tested |
---|---|---|
128x64 | Yes | Yes |
128x32 | Yes | Yes |
???x16 | Yes | NO |