OLED Setup
At the beginning of of your Python programs there is usually a few lines of setup instruction to tell the system which libraries to use, what pins to assign and what devices to initialize.
We will first look at the simple I2C setup. Then we will look at the SPI setup.
I2C Scanner
Because your microcontroller might have multiple I2C devices and displays on it, there must be some way to address the devices using an address. Most of the devices come with a default address of decimal value 60 (hex value X3C). To test this the i3c module has a i2c scan function.
1 2 3 4 5 |
|
returns: [60]
returns: [60]
SSD1306 Examples
SSD1306 I2C Setup
1 2 3 4 |
|
SSD1306 SPI Setup
Back connections:
Front labels on OLED with SPI:
Here is the connection diagram:
Here is the code:
1 2 3 4 5 6 7 8 9 10 |
|
SSH1106 I2C Setup
1 2 3 4 5 6 7 8 9 |
|