-
OLED Displays
10/17/2017 at 00:01 • 0 commentsThe code is at https://bitbucket.org/thesheep/micropython-oled/overview
See the README for explanation and examples.
This time I wrote drivers for something that mostly already had its drivers in MicroPython — the monochrome OLED displays. I did that, because I wasn't happy with the existing drivers — they are a bit elaborate in terms of indirection and inheritance. Sure, code reuse and so on, but not very nice for constrained platforms. So I did my own, trying to optimize them. I also exposed some useful functions, like flipping and hardware scrolling.
I will hopefully add some more exotic displays there, as I get specimen to test on.
-
MAX31855 Thermocouple Amplifier
02/08/2017 at 23:45 • 0 commentsThe code is at https://bitbucket.org/thesheep/micropython-max31855
See the docstrings for usage.
-
SI7021 Temperature and Humidity Sensor
02/08/2017 at 23:45 • 0 commentsThe code is at https://bitbucket.org/thesheep/micropython-si7021
See the docstrings for usage.
-
Bosch BNO055 IMU sensor
02/08/2017 at 23:44 • 0 commentsThe code is at https://bitbucket.org/thesheep/micropython-bno055
See the docstrings for usage example.
-
SHARP GP2Y0E03 Distance Sensor
09/09/2016 at 13:29 • 0 commentsThis is a small infra-red distance sensor with I²C interface. It can measure distances from 4 to 127cm. The source code is available here: https://bitbucket.org/thesheep/micropython-gp2y0e03/src
Example use:
from machine import I2C, Pin import gp2y0e03 i2c = I2C(Pin(5), Pin(4), freq=100000) s = gp2y0e03.GP2Y0E03(i2c) s.read()
-
µDisplay -- Drivers for 6 Different RGB Displays
08/28/2016 at 17:51 • 1 commentThis is a collection of 6 different displays drivers for TFT and OLED RGB displays. I finally took the time to refactor all my drivers, pull out the common parts, and put them all in a single library. Don't worry, each driver is in a separate file, so you can copy only the parts that you are actually using onto your board.
The source is at https://bitbucket.org/thesheep/micropython-display
-
DS1307, DS3231, and PCF8523 Real-Time Clocks
08/17/2016 at 14:50 • 0 commentsHere's a library for handling a bunch of popular I2C-based real-time clock chips: https://github.com/adafruit/Adafruit-uRTC
And here is the documentation for it: http://micropython-urtc.readthedocs.io/en/latest/
As you can guess from the naming, I was supported by Adafruit Industries to write this one (but of course it will work with any breakout boards for those chips, not just theirs). I will most likely create more libraries for them.
-
SH1106 OLED Display
07/15/2016 at 13:53 • 0 commentsAnother basic display driver. This one uses the framebuf module, as does the SSD1306 driver in Micropython's source tree.
https://bitbucket.org/thesheep/micropython-ili9341/src/tip/sh1106.py
The use is pretty much the same.
-
IS31FL3731 Charlie-Plexed LED Matrix
07/09/2016 at 12:36 • 0 commentsThis driver is for a monochromatic matrix of up to 144 LEDs, with hardware PWM and blinking. It also has 8 frames of memory, and can fade between them, or play animations with them -- optionally synchronized to music! The code is at https://bitbucket.org/thesheep/micropython-is31fl3731/src/tip/is31fl3731.py
Example use:
import is31fl3731 from machine import I2C, Pin i2c = I2C(Pin(5), Pin(4)) display = is31fl3731.CharlieWing(i2c) display.fill(127) display.pixel(0, 0, 2, True) display.blink(540)
-
SSD1606 E-ink display
07/01/2016 at 13:43 • 5 commentsThis is a relatively cheap SPI E-ink display that you can find on tindie. It has 4 shades of grey per pixel, and 172x72 resolution.
The code is at https://bitbucket.org/thesheep/micropython-ili9341/src/tip/ssd1606.py
Example code:
from machine import Pin, SPI import ssd1606 spi = SPI(miso=Pin(12), mosi=Pin(13, Pin.OUT), sck=Pin(14, Pin.OUT)) display = ssd1606.SSD1606(172, 72, spi, Pin(4), Pin(5), Pin(2), Pin(15)) display.fill(3) display.pixel(10, 10, 0) display.show()
And the display: