-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Micropython support #92
base: master
Are you sure you want to change the base?
Conversation
class method works with __setattr__ and __getattr__, so removing the complicated metaclass
- collections is renamed ucollections in micropython - threading isn't available on all ports of micropython - __future__doesn't seem to be available, presumably because micropython code isn't meant to be ported between versions
5a95d91
to
812b313
Compare
This is a great idea! I don't have experience with MicroPython so I'm not sure what to do about pin numbering etc. but I'm looking forward to seeing this develop 💯 |
2ca201a
to
9d96275
Compare
@alxwrd any progress? 😄 |
😅 soon™ Just need to find some time to have a play with RPi.GPIO to see how I can get the PWM apis to line up. I've just had some thoughts about fixing up the tests at least. I might jump on that now. |
Sounds awesome! If needed we could refactor out calls to Are the tests specific to Micropython support or would that be a separate PR? |
53ee2b8
to
8c00567
Compare
Oops, sorry! I meant the test(s) failing for this PR. I still need to have a good think about testing in general. With the gpio interface, that was my thinking with db5940d, it makes micropython behave like RPi. But yea, going foward might be good to look at a general interface for both. |
Missed that, oops - yep that's the kind of thing I meant. Looks cool ✨ Ah tests are looking better now, all 8 of them 😬 this package could definitely do with some more 😂 do you have any ideas for how we could test this new stuff? |
hello 👋 !!
This adds support for using
l293d
with Micropython.Changes
I've stripped back the
Config
class, as it was using some features that Micropython doesn't support (__dict__
,with_metaclass
hacks). Now an instance ofConfig
is created on module load, and__getattr__
and__setattr__
are class methods.I've created a
gpio
submodule to handle loading in what to use for GPIO. This allowed me to make a wrapper for Micropythonsmachine
that mirrorsRPi.GPIO
. I also added atestgpio
that is used when nothing GPIO related can be imported (might be useful for Add tests to avoid problems like #61 #62).WIP
Currently a work in progress as there are some things I need to figure out:
RPi.GPIO
to see what it supports.