Raspberry Pi Pico Animations on OLED displays using CircuitPython
HTML-код
- Опубликовано: 3 июл 2024
- Raspberry Pi Pico Animations on OLED displays using CircuitPython
There are many ways to load and display an animation on an OLED screen, either with Arduino or CircuitPython. I am going to show you what I think is the easiest way to achieve it. I will work with the monochrome OLED, but the procedure works with the Color one as well with only one minor difference that I will show you later in this video.
🛒 Monochrome OLED: educ8s.tv/part/OLED096
🛒 Color OLED: educ8s.tv/part/ColorOLED
🛒 Raspberry Pi Pico: educ8s.tv/part/RaspberryPiPico
💻 Gif 2 Sprite Sheet: github.com/educ8s/Python-GIF-...
💻 Code: educ8s.tv/oled-animation/
Join this channel to get access to perks:
/ @educ8s
0:00 Intro
0:23 Hardware used
0:44 What is animation?
2:20 Software needed
4:00 Convert GIF to Sprite Sheet
#circuitpython #educ8stv #raspberrypi Наука
Your circuit Python videos are great!
Good work. Back in 2017 I learned how to display bitmap image on Nokia lcd from your tutorials.
Hello my friend, I am so happy to hear that. It means, my work helps some people!
Surely It helps a lot even if it’s for few people.
Please keep doing the things you love to do.
Brilliant - as always. Thanks!!
Thanks!
Great stuff. Love what you are doing with CIrcuitPython.
Glad you enjoy it Tim! CircuitPython makes some things extremely easy!
Great find
Great video as always
Thanks for sharing your experiences with all of us 🙂
Thanks for the nice words, I really appeciate it!
You are such a cool guy doing great videos! Muchas Gracias Thank You.
First of all thank you very much for the financial support! Thank you for your nice words and I am really happy that you find the videos useful!
Yasou Nick! Summers in Kim’s, Evian😁 Great video. I joined your other channel too. Looking forward to more videos.
Good video
Glad you enjoyed!
Good video😉
Thanks 😁
Have you had any luck connecting multiple oleds to a pico ?
If you take out the micro usb will the animation run independently with a separate power source
yes
Is there a faster way to display gifs? the animation playback is quite slow this way. When i was using micropython i was able to play at 60fps by using blit with individual frames
Will you make tutorial for micropython too?
I recently bought ESP32 and flashed bootloader to use micropython.
I wonder if this will work with this OLED too.
I don't know if there is MicroPython library that supports animation of spritesheets. I will take a look. Thanks for the idea...
Hi Nick, thank you for making amazing training material.
I have a question about little project i'm doing.
The project has two buttons and a 12v LED strip. One button press needs to start LEDs flash then when the button is pressed again LEDs to stop.
Second button when pressed LEDs will start flashing then stop on its own after few seconds.
How can I go about doing that?
I don't have your email so wrote it here if that ok :)
I'm useing FastLED library and this is my code without buttons (not sure how to make add buttons to make the above operation) :
#include
#define NUM_LEDS 60
#define LED_PIN 6
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds(leds, NUM_LEDS);
FastLED.setBrightness(1);
}
void loop() {
// Turn the LED on, then pause
fill_solid( leds, NUM_LEDS, CRGB( 255, 255, 255 ) );
FastLED.show();
delay(20);
fill_solid( leds, NUM_LEDS, CRGB( 0, 0, 0 ) );
FastLED.show();
delay(200);
}
Sorry if this is a wrong place to post. Don't have your email.
Thank you :)
Do you think i can do the same if I have Feather RP2040 board and ST7789 TFT 1.47" display? I have been trying to make Mini gif player with the guide, but couldn't get it to work. So right now I'm trying yours project.
Sure, I think it will work. Let me know how it went.
@@Educ8s It worked. All i have to do was follow yours guide and change GP0 and GP1 to this "sda, scl = board.SDA, board.SCL" . This is the first animation guide that i was able to do correctly. Thank you for the project.
RuntimeError: No pull up found on SDA or SCL; check your wiring 😢
I'm trying code with Pi Pico, circuit python, screen nokia 5110 with adafuit_pcd5844 but it's not run yet. Please help:
run_action.bmp (1bit depth, 84x48 pixel, x 25 fp)
#
import board, busio, displayio, time
import digitalio
import adafruit_pcd8544
import adafruit_imageload
image, palette = adafruit_imageload.load(
"run_action.bmp", bitmap=displayio.Bitmap, palette=displayio.Palette
)
tile_grid = displayio.TileGrid(image, pixel_shader=palette)
IMAGE_FILE = "run_action.bmp"
SPRITE_SIZE = (84, 48)
FRAMES = 25
def invert_colors():
temp = icon_pal[0]
icon_pal[0] = icon_pal[1]
icon_pal[1] = temp
displayio.release_displays()
mosi_pin = board.GP11
clk_pin = board.GP10
spi = busio.SPI(clock=clk_pin, MOSI=mosi_pin)
dc = digitalio.DigitalInOut(board.GP16) # data/command
cs = digitalio.DigitalInOut(board.GP18) # Chip select
reset = digitalio.DigitalInOut(board.GP17) # reset
display = adafruit_pcd8544.PCD8544(spi, dc, cs, reset)
display.bias = 5
display.contrast = 8
icon_bit, icon_pal = adafruit_imageload.load(IMAGE_FILE, bitmap=displayio.Bitmap, palette=displayio.Palette)
invert_colors()
icon_grid = displayio.TileGrid(icon_bit, pixel_shader=icon_pal,
width=1, height=1,
tile_height=SPRITE_SIZE[1], tile_width=SPRITE_SIZE[0],
default_tile=0,
x=48, y=0)
group = displayio.Group()
group.append(icon_grid)
display.show()
timer = 0
pointer = 0
while True:
if (timer + 0.1) < time.monotonic():
icon_grid[0] = pointer
pointer += 1
timer = time.monotonic()
if pointer > FRAMES-1:
pointer = 0