Skip to content

Instantly share code, notes, and snippets.

View benalb's full-sized avatar

Benjamín Albiñana benalb

View GitHub Profile
@benalb
benalb / ScrollP.py
Created April 10, 2021 06:34
Use the Scroll Phat from pimoroni with esp32
""" Orginal code for microbit http://multiwingspan.co.uk/micro.php?page=phatscroll
this works with m5stickC (esp32 Pico)
from machine import I2C, Pin
from ScrollP import *
i2c = I2C(scl=Pin(32), sda=Pin(33))
sp = ScrollP(i2c)
sp.set_pixel(0,0,1)
sp.show()
"""
@benalb
benalb / pmws.py
Created February 14, 2021 17:54
poor man's weather station with rpi pico.
from machine import Pin, SPI, ADC
import ssd1306
import utime
spi = SPI(0,100_000,polarity=1,phase=1)
dc = Pin(4, Pin.OUT)
res = Pin(3, Pin.OUT)
cs = Pin(5, Pin.OUT)
oled = ssd1306.SSD1306_SPI(128,64,spi,dc,res,cs,False)