Skip to content

benevpi/Adafruit_CircuitPython_BusDevice_for_MicroPython

 
 

Repository files navigation

Adafruit CircuitPython BusDevice For MicroPython

A fork of https://github.com/adafruit/Adafruit_CircuitPython_BusDevice to work in MicroPython on Raspberry Pi Pico. It may or may not work on other MicroPython hardware

I've driven a bus through some probably very well thought out enginerring in order to get this to work. It may or may not need to be added back in at a later stage.

So far, I've only done I2C as I don't have any SPI devices to test with.

Changes:

  • removed try_lock as that concept doesn't seem to exist in MicroPython
  • readto and writeto are both no longer using their start and stop parameters. This may cause a problem for some sensors.

Currently tested devices Pimoroni BMP280 breakout.

Example code (you'll also need this file saved on your device: https://github.com/adafruit/Adafruit_CircuitPython_BMP280/blob/master/adafruit_bmp280.py):

from machine import Pin, I2C
i2c = I2C(0,scl=Pin(21), sda=Pin(20))

import adafruit_bmp280
sensor = adafruit_bmp280.Adafruit_BMP280_I2C(i2c, address=0x76)
If you get the following error::
AttributeError: 'module' object has no attribute 'monotonic'

you need to do a search and replace for 'monotonic' and replace it with 'ticks_ms'

About

Two helper classes that handle transaction related state for I2C and SPI including locks.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy