|
Raspberry Pi Pico |
x 1 | |
|
Monochrome Oled I2C Display |
x 1 |
Raspberry Pi Pico With I2C Oled Display and CircuitPython
This is my first experience using this little board from Raspberry Pi Foundation.
I preferred to install CircuitPython on the board, but I came across the lack of usage examples (because the board was just released, obviously). Many of the examples on the Adafruit website have not yet been ported to the new board, so I am experimenting and making the necessary adaptations.
As they work, I'll share them here.
First, install CircuitPython in your little board. Just follow this guide:
https://learn.adafruit.com/getting-started-with-ra...
Second, download the CircuitPython Library Bundle:
https://github.com/adafruit/CircuitPython_Communit...
Third, install your favorite IDE (I preffer Thonny, but Adafruit indicates MU).
The connection is as simple as follows:
SSD1306 | Pico
VCC ---> Pin 36
GND ---> Any GND available
SDA ---> Pin 6 (GP4)
SCL ---> Pin 5 (GP5)
On the back of the Oled board there is an address indication and a jumper. In the case of my card, the addresses indicated are 0x7A or 0x7B. None of them work. The correct would be 0x3C.
In the Adafruit guide https://learn.adafruit.com/getting-started-with-r... there is an indication that calls to the I2C bus are executed through the BUSIO module.
No Default board Devices
The Pico does not label specific pins as the defaults to use for I2C, SPI, or UART connections.
I2C Example
To setup an I2C bus, you specify the SCL and SDA pins being used. You can look for "SCL" and "SDA" in the pin names in the pinout diagram above.
So, I use the code:
import board import busio i2c = busio.I2C (scl=board.GP5, sda=board.GP4) # This RPi Pico way to call I2C
The second piece of code I've found in this other guide:
https://learn.adafruit.com/adafruit-oled-featherwi... So, I've changed two things: the display resolution and I2C call...
# Adapting the example in https://learn.adafruit.com/adafruit-oled-featherwing/python-usage # to use with Raspberry Pi Pico and CircuitPython import board import busio import displayio import terminalio import adafruit_displayio_ssd1306 from adafruit_display_text import label i2c = busio.I2C (scl=board.GP5, sda=board.GP4) # This RPi Pico way to call I2C display_bus = displayio.I2CDisplay (i2c, device_address = 0x3C) # The address of my Board display = adafruit_displayio_ssd1306.SSD1306(display_bus, width=128, height=64) splash = displayio.Group(max_size=10) display.show(splash) color_bitmap = displayio.Bitmap(128, 64, 1) # Full screen white color_palette = displayio.Palette(1) color_palette[0] = 0xFFFFFF # White bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0) splash.append(bg_sprite) # Draw a smaller inner rectangle inner_bitmap = displayio.Bitmap(118, 54, 1) inner_palette = displayio.Palette(1) inner_palette[0] = 0x000000 # Black inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=5, y=4) splash.append(inner_sprite) # Draw a label text = "Nicolau dos" text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00, x=28, y=15) splash.append(text_area) text = "Brinquedos" text_area = label.Label(terminalio.FONT, text=text, color=0xFFFF00, x=32, y=25) splash.append(text_area) while True: pass
?
Raspberry Pi Pico With I2C Oled Display and CircuitPython
- Comments(0)
- Likes(1)
- Engineer Aug 20,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by nicolaudosbrinquedos
- Homeassistant in Beaglebone Black With Debian 11 Intro: The primary objective of my project was to give some use to the Beaglebone Black that has bee...
- The Adventures of Porting Circuitpython to Wio RP2040 I have been developing some electronic props solutions for Escape Rooms. And periodically I usually ...
- Simple Electronics to Escape Room Owners - Using a bunch of voltmeters with PCA9685 This is a preliminary study for an Escape Room game. My main goal was to add as many analog displays...
- Simple Electronics to Escape Room Owners - First Chapter I've been developing puzzles and artifacts for Escape Room since 2018 and most of the time, I've bee...
- Finally! Animated Eyes using Seed Xiao RP2040 This is another advance in my studies to enable a more economically viable version for the Monster M...
- Circuitpython on Seeed XIAO RP2040 Step 1: Unboxing... I2C Not Working?As soon as the card arrived, I installed the firmware version fo...
- Raspberry Pi Pico with GC9A01 Round Display using Arduino IDE and TFT-eSPI Library This is a work in progress for another one of the artifacts I used in Leonardo Cortez's "Strange Hou...
- Recreating an 80s TV with Raspberry Pi Recently I built a series of special effects for the scenography of the play "Strange House" by Leon...
- Talk to Me This project is part of an extensive research on the use of animatronics and interactive objects tha...
- Back in time! Make a Zoetrope using Arduino I'm working on a series of animated objects for a children's play and decided to build a Zoetrope, t...
- Alastor Moody Eye using Raspberry Pi Pico, CircuitPython and Round Display GC9A01 I am developing a series of objects for a children's play about fear and terror. And then I got insp...
- The Crazy Pots Game At some point on the internet I came across someone who had made a game like that, but unfortunately...
- Arduino Mastermind Game I created this little game as a hobby for my children during the Covid-19 quarantine. I had already ...
- Raspberry Pi Pico With I2C Oled Display and CircuitPython This is my first experience using this little board from Raspberry Pi Foundation.I preferred to inst...
- Raspberry Pi Pico and TFT ILI9341 with Circuit Python I decided to write another tutorial on the Raspberry Pi Pico, mainly because the card is very recent...
- Arduino Minesweeeper It was then that I found the works of Rachit Belwariar, on the page https://www.geeksforgeeks.org/cp...
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
59 0 0 -
DIY Laser Power Meter with Arduino
51 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
110 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
309 0 1 -
Custom Mechanic Keyboard - STM32
224 0 3