Modules - Device Drivers
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Modules - Device Drivers
Yes, I've read about the hardware support, but it only supports a small number of encoders. I also tried the example by dyhlands, but it did not seem to work as reliable as my approach. Also, I want scaling and min / max bounds of the counter (with or without wrap-around), which is easier, if I maintain the counter myself.
Re: Modules - Device Drivers
@SpotlightKid - In my eagerness to try your midi module with GarageBand on an iPad I connected a 9v to Gnd and, whoops, 3v3 ... so that little test will have to wait till my replacement pyboards turn up
But if it works; what a way to enthuse my kids to take up Python ...
But if it works; what a way to enthuse my kids to take up Python ...
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Watchdog timer
A simple class for accessing the Pyboad's watchdog timer (a device which resets the Pyboard in the event of a software or hardware fault).
To use, create a watchdog instance and call its start() method with the required period in mS. Your code should periodically call feed(). If the dog doesn't get fed in the specified period, the Pyboard will be reset. It is valid to call start() multiple times to alter the watchdog period.
Code: Select all
import stm
@micropython.asm_thumb
def clz(r0):
clz(r0, r0) # return no. of leading zeros in passed integer
class wdog(object):
def start(self, ms):
assert ms <= 32768 and ms >= 1, "Time value must be from 1 to 32768mS"
prescaler = 23 - clz(ms -1)
div_value = ((ms << 3) -1) >> prescaler
stm.mem16[stm.IWDG + stm.IWDG_KR] = 0x5555
stm.mem16[stm.IWDG + stm.IWDG_PR] = (stm.mem16[stm.IWDG + stm.IWDG_PR] & 0xfff8) | prescaler
stm.mem16[stm.IWDG + stm.IWDG_RLR] = (stm.mem16[stm.IWDG + stm.IWDG_RLR] & 0xf000) | div_value
stm.mem16[stm.IWDG + stm.IWDG_KR] = 0xcccc
def feed(self):
stm.mem16[stm.IWDG + stm.IWDG_KR] = 0xaaaa
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Modules - Device Drivers
Thank you very much Pythoncoder, it works great!!
SBUS receiver driver
Hello,
I just posted on github a driver for SBUS receivers:
https://github.com/Sokrates80/sbus_driver_micropython
I just posted on github a driver for SBUS receivers:
https://github.com/Sokrates80/sbus_driver_micropython
Re: Modules - Device Drivers
Perhaps we should make an awesome-micropython list on Github.
eg. https://github.com/vinta/awesome-python
A few of my drivers:
Aosong DHT12 (upgrade of DHT11, now with I2C):
https://github.com/mcauser/micropython-dht12
Aosong AM2320 (upgrade of DHT22, now with I2C):
https://github.com/mcauser/micropython-am2320
MLX90614 IR temperature sensor:
https://github.com/mcauser/micropython-mlx90614
PCD8544 84x48 LCD (Nokia 5110)
https://github.com/mcauser/micropython-pcd8544
Quad 7-segment LED display modules based on TM1637 LED driver (Seeed 4 digit display)
https://github.com/mcauser/micropython-tm1637
LED matrix based on TM1640 LED driver
https://github.com/mcauser/micropython-tm1640
SSD1327 128x128 4-bit greyscale OLED displays (Seeed 96x96 OLED)
https://github.com/mcauser/micropython-ssd1327
P9813 chainable RGB LEDs (Seeed Grove Chainable RGB LED)
https://github.com/mcauser/micropython-p9813
MCP23017 16-bit I/O Expander
https://github.com/mcauser/micropython-mcp23017
PCF8574 8-Bit I2C I/O Expander with Interrupt
https://github.com/mcauser/micropython-pcf8574
PCF8575 16-Bit I2C I/O Expander with Interrupt
https://github.com/mcauser/micropython-pcf8575
eg. https://github.com/vinta/awesome-python
A few of my drivers:
Aosong DHT12 (upgrade of DHT11, now with I2C):
https://github.com/mcauser/micropython-dht12
Aosong AM2320 (upgrade of DHT22, now with I2C):
https://github.com/mcauser/micropython-am2320
MLX90614 IR temperature sensor:
https://github.com/mcauser/micropython-mlx90614
PCD8544 84x48 LCD (Nokia 5110)
https://github.com/mcauser/micropython-pcd8544
Quad 7-segment LED display modules based on TM1637 LED driver (Seeed 4 digit display)
https://github.com/mcauser/micropython-tm1637
LED matrix based on TM1640 LED driver
https://github.com/mcauser/micropython-tm1640
SSD1327 128x128 4-bit greyscale OLED displays (Seeed 96x96 OLED)
https://github.com/mcauser/micropython-ssd1327
P9813 chainable RGB LEDs (Seeed Grove Chainable RGB LED)
https://github.com/mcauser/micropython-p9813
MCP23017 16-bit I/O Expander
https://github.com/mcauser/micropython-mcp23017
PCF8574 8-Bit I2C I/O Expander with Interrupt
https://github.com/mcauser/micropython-pcf8574
PCF8575 16-Bit I2C I/O Expander with Interrupt
https://github.com/mcauser/micropython-pcf8575
Last edited by mcauser on Wed Dec 11, 2019 3:12 am, edited 3 times in total.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Modules - Device Drivers
That's fine so long as there are people willing to take on the task of curating it. Otherwise we have the Wiki http://wiki.micropython.org/Home.mcauser wrote:Perhaps we should make an awesome-micropython list on Github...
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Modules - Device Drivers
This is a collection of libraries I've put together for my own use, with the awareness someone else might pick them up and use them.
Renderer-agnostic pixel fonts for python3, a micropython port of fonts sourced by @olikraus for u8g2
https://github.com/ShrimpingIt/bitfont
Low Overhead JSON parsing
https://github.com/ShrimpingIt/medea
For MCP23008 and MCP23017 GPIO expanders
https://github.com/ShrimpingIt/micropython-mcp230xx
For DFPlayer MP3 Player
https://github.com/ShrimpingIt/micropython-dfplayer
For ST7920 Monochrome LCD
https://github.com/ShrimpingIt/micropython-st7920
WebREPL served direct from ESP8266
https://github.com/ShrimpingIt/cockle/t ... replserver
Renderer-agnostic pixel fonts for python3, a micropython port of fonts sourced by @olikraus for u8g2
https://github.com/ShrimpingIt/bitfont
Low Overhead JSON parsing
https://github.com/ShrimpingIt/medea
For MCP23008 and MCP23017 GPIO expanders
https://github.com/ShrimpingIt/micropython-mcp230xx
For DFPlayer MP3 Player
https://github.com/ShrimpingIt/micropython-dfplayer
For ST7920 Monochrome LCD
https://github.com/ShrimpingIt/micropython-st7920
WebREPL served direct from ESP8266
https://github.com/ShrimpingIt/cockle/t ... replserver
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Modules - Device Drivers
Measure Temperature and Humidity
AM2320 using a 1 wire protocol. This is an i2c device, but can be wired to run as a 1 wire device
https://github.com/rhubarbdog/AM2320_1wire
AM2320 using a 1 wire protocol. This is an i2c device, but can be wired to run as a 1 wire device
https://github.com/rhubarbdog/AM2320_1wire
Re: Modules - Device Drivers
Hi, here some contribution from MCHobby for MicroPython drivers.
Not everything is translated to english but new ones are.
read RGB888 BMP image (ability to read a small X,Y portion of image)
https://github.com/mchobby/esp8266-upy/ ... FILEFORMAT
AD9833 signal generator
https://github.com/mchobby/esp8266-upy/ ... ter/ad9833
AM2315 temperature & hymidity sensor
https://github.com/mchobby/esp8266-upy/ ... ter/am2315
Adafruit USB/Serial backpack LCD display (with RGB backlight)
https://github.com/mchobby/esp8266-upy/ ... er/lcdmtrx
MCP4725 DAC (I2C)
https://github.com/mchobby/esp8266-upy/ ... er/mcp4725
MCP9808 (I2C) accuracy temperature sensor
https://github.com/mchobby/esp8266-upy/ ... er/mcp9808
MODIO (I2C) relay board from Olimex
https://github.com/mchobby/esp8266-upy/ ... ster/modio
MODIO2 (I2C) relay board from Olimex
https://github.com/mchobby/esp8266-upy/ ... ter/modio2
MLX90614BAA thermopile temperature sensor
https://github.com/mchobby/esp8266-upy/ ... /modirtemp
MOD-LCD1x9 (I2C) from Olimex - minimalist LCD display
https://github.com/mchobby/esp8266-upy/ ... /modlcd1x9
MOD-LED8x8RGB (SPI) chainable LED display with FrameBuffer support (still from Olimex)
https://github.com/mchobby/esp8266-upy/ ... /modled8x8
LTR-501ALS Lux reader
https://github.com/mchobby/esp8266-upy/ ... /modltr501
MAG3110 - 3 axis magnetic sensor
https://github.com/mchobby/esp8266-upy/ ... ter/modmag
MOD-RFID1536 - MiFare RFID reader (UART) from Olimex
https://github.com/mchobby/esp8266-upy/ ... er/modrfid
Examples ported to MicroPython (not perfect yet).
MOD-RGB - analog RGB strip LED controler from Olimex
https://github.com/mchobby/esp8266-upy/ ... ter/modwii
Several NCD (National Control Device) boards - using 5V I2C bus
Includes Fet Solenoid Controler Board, SI7005 humidity/temperature board, Pecmac power monitor, etc.
https://github.com/mchobby/esp8266-upy/ ... man_NCD.md
PCA8536 - 4Bits GPIO Extender (I2C)
https://github.com/mchobby/esp8266-upy/ ... er/pca9536
TCS34725 - color sensor (I2C)
https://github.com/mchobby/esp8266-upy/ ... r/tcs34725
TSL2591 - Lux Sensor (I2C)
https://github.com/mchobby/esp8266-upy/ ... er/tsl2591
Not everything is translated to english but new ones are.
read RGB888 BMP image (ability to read a small X,Y portion of image)
https://github.com/mchobby/esp8266-upy/ ... FILEFORMAT
AD9833 signal generator
https://github.com/mchobby/esp8266-upy/ ... ter/ad9833
AM2315 temperature & hymidity sensor
https://github.com/mchobby/esp8266-upy/ ... ter/am2315
Adafruit USB/Serial backpack LCD display (with RGB backlight)
https://github.com/mchobby/esp8266-upy/ ... er/lcdmtrx
MCP4725 DAC (I2C)
https://github.com/mchobby/esp8266-upy/ ... er/mcp4725
MCP9808 (I2C) accuracy temperature sensor
https://github.com/mchobby/esp8266-upy/ ... er/mcp9808
MODIO (I2C) relay board from Olimex
https://github.com/mchobby/esp8266-upy/ ... ster/modio
MODIO2 (I2C) relay board from Olimex
https://github.com/mchobby/esp8266-upy/ ... ter/modio2
MLX90614BAA thermopile temperature sensor
https://github.com/mchobby/esp8266-upy/ ... /modirtemp
MOD-LCD1x9 (I2C) from Olimex - minimalist LCD display
https://github.com/mchobby/esp8266-upy/ ... /modlcd1x9
MOD-LED8x8RGB (SPI) chainable LED display with FrameBuffer support (still from Olimex)
https://github.com/mchobby/esp8266-upy/ ... /modled8x8
LTR-501ALS Lux reader
https://github.com/mchobby/esp8266-upy/ ... /modltr501
MAG3110 - 3 axis magnetic sensor
https://github.com/mchobby/esp8266-upy/ ... ter/modmag
MOD-RFID1536 - MiFare RFID reader (UART) from Olimex
https://github.com/mchobby/esp8266-upy/ ... er/modrfid
Examples ported to MicroPython (not perfect yet).
MOD-RGB - analog RGB strip LED controler from Olimex
https://github.com/mchobby/esp8266-upy/ ... ter/modwii
Several NCD (National Control Device) boards - using 5V I2C bus
Includes Fet Solenoid Controler Board, SI7005 humidity/temperature board, Pecmac power monitor, etc.
https://github.com/mchobby/esp8266-upy/ ... man_NCD.md
PCA8536 - 4Bits GPIO Extender (I2C)
https://github.com/mchobby/esp8266-upy/ ... er/pca9536
TCS34725 - color sensor (I2C)
https://github.com/mchobby/esp8266-upy/ ... r/tcs34725
TSL2591 - Lux Sensor (I2C)
https://github.com/mchobby/esp8266-upy/ ... er/tsl2591