MicroPython support added back in (an unofficial library feature) #18
2bndy5
started this conversation in
Show and tell
Replies: 2 comments 7 replies
-
|
I'm also currently working on getting the above wrapper implementation integrated into this |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
So, it's just lacking the shims only ? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Above is the import statement from the
rf24.pyfile (as of v1.2.0 release). First it looks for a module namedubus_devicewhich contains a class namedSPIDevice, then falls back to looking for the widely availableadafruit_bus_device.spi_devicemodule. Thisubus_devicefile is not located in this library's releases as it is an adapted version of the CircuitPython dependencyadafruit_bus_device.spi_devicecontaining the original code written by "Scott Shawcroft for Adafruit Industries" (both files share a MIT license).The necessary files needed to make this library work on MicroPython are located in my separate repository called CircuitPython_2_Micropython. These files are:
ubus_deviceThis is a substitute foradafruit_bus_device.spi_devicethat wraps MicroPython'smachine.SPIclass into a context manager compatible module.udigitalioThis file contains a class namedDigitalInOut. This file is meant to be a substitute for CircuitPython'sdigitaliomodule and wraps MicroPython'smachine.Pinclass into an interface compatible withdigitalio.DigitalInOutclass. This file isn't directly imported byrf24.py, but it is needed to declare the nRF24L01's CE & CSN pins' objects that are passed to theRF24constructor.These files were tested on a tinypico (ESP32) with
rf24.py,ubus_device.py, &udigitalio.pyall located at the filesystem's root directory. I should mention that theudigitalio.pyfile is not compatible with the ESP8266 platform running MicroPython due to differences in the pull up/down resistors available (tested on a nodeMCU board). The following snippet demonstrates how to use the above listed files (located at root directory of the platform's file system) in MicroPython:Beta Was this translation helpful? Give feedback.
All reactions