MicroPython Device Drivers for BBC micro:bit
Introduction
This website presents a host of MicroPython drivers, all for the BBC micro:bit. It is an ever increasing collection. Each driver has been tested on the micro:bit V2 that is hooked up to the device the driver has been written to control.
The driver code contains basic error checking. However unlike the compiled code drivers written e.g. for the Arduino platform, catching and dealing with exceptions in this MicroPython driver collection is largely left to the user program. MicroPython is an interpreted language and lengthy routines performing error checking that may never be used would seriously impact available Flash memory.
These drivers are free for you to copy, use and enjoy. While each driver has been extensively tested with the micro:bit interfaced to the device, there is no warranty and you use the code at your own risk.
Alphabetical Listing of Available Drivers
Following is an alphabetical list of the MicroPython device drivers written specifically for the micro:bit. Each driver webpage provides the code, a full description on how to connect the device to the micro:bit and full documentation on public methods including code examples.
- ADT7410 Weather Station Sensor (ambient temperature, I2C interface)
- ADXL335 (acceleration, analog interface)
- ADXL345 (acceleration, I2C interface)
- ADXL362 (acceleration, SPI interface)
- AHT10, AHT15 Weather Station Sensor (relative humidity, ambient temperature, I2C interface)
- AHT20, AHT21 Weather Station Sensor (relative humidity, ambient temperature, I2C interface)
- AHT20 & BMP280 Breakout Board Weather Station Sensor (relative humidity, ambient temperature, relative humidity, I2C interface)
- AHT30 Weather Station Sensor (relative humidity, ambient temperature, I2C interface)
- BMA400 accelerometer (acceleration, I2C interface)
- BME280 Weather Station Sensor (barometric pressure, ambient temperature, relative humidity, I2C interface)
- BMP180 Weather Station Sensor (barometric pressure, ambient temperature, I2C interface)
- BMP280 Weather Station Sensor (barometric pressure, ambient temperature, I2C interface)
- BMP388 Weather Station Sensor (barometric pressure, ambient temperature, I2C interface)
- BMP390 Weather Station Sensor (barometric pressure, ambient temperature, I2C interface)
- BMP580 Weather Station Sensor (barometric pressure, ambient temperature, I2C interface)
- BMP581 Weather Station Sensor (barometric pressure, ambient temperature, I2C interface)
- BMP585 Weather Station Sensor (barometric pressure, ambient temperature, I2C interface)
- DHT12 Weather Station Sensor (relative humidity, ambient temperature, I2C interface)
- DS1302 Real-Time Clock (date, time, SPI interface)
- DS1307 Real-Time Clock (date, time, alarms, I2C interface)
- DS3231 Real-Time Clock (date, time, alarms, I2C interface)
- HC-SR04P (Ultrasonic distance sensor, I2C interface)
- HC-SR04P (Ultrasonic distance sensor, HC-SR04 digital pins interface)
- LIS2DW12 Accelerometer (temperature, I2C interface)
- LIS3DH Accelerometer (temperature, I2C interface)
- LIS3DSH Accelerometer (temperature, I2C interface)
- LM75A Weather Station Sensor (temperature, I2C interface)
- Logic Gate Tester (tests 1, 2, 3 and 4-input logic gates)
- MB85RC256V FRAM Memory (32KB, I2C serial interface)
- MMA8451 Accelerometer (I2C interface)
- MMA8452 Accelerometer (I2C interface)
- OpenLog (data logger, UART serial interface)
- PCT2075 Weather Station Sensor (temperature, I2C interface)
- PCF8563 real-Time Clock (date, time, alarm, countdown timer, I2C interface)
- SHT40, SHT45 Weather Station Sensor (relative humidity, ambient temperature, I2C interface)
- TCA9548A I2C multiplexer (8-channels, I2C interface)
- TM1637 LED 7-segment (4-digit LED display, proprietary serial interface)
- US-100 (Ultrasonic distance sensor, UART interface)
- US-100 (Ultrasonic distance sensor, HC_SR04 digital pins interface)