Driver for SH1106:
Installer for the luma sh1106 OLED python library
How to Install Luma
sudo pip3 install luma luma.oled
How to Run Luma Examples on sh1106 1.3" OLED screen:
python3 DemoFileName.py -i spi --display sh1106 --rotate 2
Luma Example Script Explanations:
- runner.py # Shows an animation of a person running from one side of the screen to the other, then back again. Could be used to make an OLED game or animation
- bounce.py # Shows circles of various sizes bouncing off the 4 sides of the screen.
- Tests the video power in a way.
- For example, RPi 0 seems to get around 15 fps with this script, where Raspberry Pi Zero 2 gets 60+ and looks pretty cool!
- Could be used as an Intro screen, Loading screen or other animation (in an OLED game)
- carousel.py # Shows tons of sys info in a horizontal pane-style smooth-scrolling carousel (clock, IP addresses per interface, etc).
- This could easily be added to BeBoXGui in addition to / in replacement of the existing System Information menu item
- crawl.py # Smooth-scrolls lines of text vertically across the screen - like the intro text of a popular old SciFi movie 😉 Great for explanations / Help screens
- demo.py # Awesome example of fading in and out the brightness of the OLED display.
- Super cool. This actually does a lot - wait for it to get past the "dim/bright" cycle testing.
- "Glowing" screen effect - tests dim / bright cycle (0 to 100%) with shapes (ellipse, triangle, square, lines, text)
- Fast on/off ("flashing" of entire screen) vs. full display clearing vs. fast screen updates
- Scrolling marquee text (perfect for a Status bar with side-scrolling Notifications / messages). This screen also has a clock display (with thousands of a second).
- dotmatrixtool.py # Display a dot-matrix coded "image" (Google "convert image to OLED")
- invaders.py # Space invaders demo adapted from this code.
- sprite_animation.py # Uses a PNG sprite sheet of Mickey Mouse to display an animation.
- Could find a different sprite sheet on the web, change a few lines of code (pixel layout of the new sprite sheet), and have it display whatever sprite sheet you want
- sys_info.py # Shows text system info
- Shows Load, Uptime, Memory Used, SD Used, wlan0 Transmit & Receive (Tx/Rx)!
- This could be used to show Up and Down arrow icons on a P4wnP1 dashboard, to indicate Transmitting and Receiving of data
- sys_histogram.py # Super nice sys info histogram
- This is just a graphical version of sys_info.py - very cool.
- Could copy code snippets from this to Dashboard to show system info right on the Dashboard (CPU load, mem, etc)
- terminal.py # Shows text in a typewriter-style terminal output. And way more.
- This is what I was hoping OledTerm would be.
- This shows lots of program output in a terminal window, then a progress bar, a backspace test, and a tabs test.
- Location / cmd: pi@raspberrypi:~/p4wnsolo/zips_21-12-05/ianscripts/oledp4wnp1/luma.examples/examples $ python3 terminal.py -i spi --display sh1106
- Progress bar (fast-updating)
- Small text test for terminal output
- welcome.py # Shows strings of text in various fonts / languages. Would be great for a "Credits" screen
- starfield.py # Shows a screensaver-style starfield. Reverse the direction of the internal counter to make the stars come together!
- larson_hue.py # Very cool, fast gradient style animation. It's kind of looks like a flashlight shining from the left of the screen to the right and back again. Could be used or a "Scanning", "Loading", or "Searching" screen.
- jetset_willy.py # Animations of 2 characters walking from one side of the screen to the other, while a third character stands there and moves their arm. Could be used as an animation or to make an OLED game.
- scrolling_pixelart # Smooth scrolls through portions of a larger image
- pi_logo.py # Turns a PNG image into grayscale and rotates it to make it animated
- greyscale.py # Shows a color PNG image (balloon.png), but dithered to grayscale. Then shows a gradient dithered to greyscale.
- I ended up modifying this to display a QR code on OLED screen for fast remote-connecting using smartphone
Honorable mentions / couldn't figure it out:
Use animated GIF of pirate flag instead of banana-dance in animated_gif.py of luma.examples
Also use a better sprite animation than Mickey Mouse in sprite_animation.py
Local Working Folder on RPi0 2: