Skip to content
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

V2 support #31

Open
whaleygeek opened this issue Oct 14, 2020 · 1 comment
Open

V2 support #31

whaleygeek opened this issue Oct 14, 2020 · 1 comment

Comments

@whaleygeek
Copy link
Owner

V2 micro:bit has just been released this week. Noteable features to add support to bitio are:

  • loud/quiet sensing and threshold detection
  • support for music library (play sounds)
  • selecting cap or resistive touch sensing mode
  • touch sensing on the eyes logo

Also, there is a new 'combined hex' format, so we should roll together the V1.5 and V2 hex files into a single combined hex using the tool that the foundation are releasing. This will also close #23

Might choose to add some much needed GPIO features at same time.

Have some ideas to make api.py either an auto-sensing proxy, or a data driven table of API methods (rather than having to hand-code new method wrappers every time), so would like to experiment with that.

The auto sensing proxy would use getattr to build a wrapper for any function, and if it gets an exception when passing to the REPL on first use, it would replace it's implementation with an error handler. This might fail unhelpfully if the first call has an invalid parameter though.

The data-driven approach would be the same as the auto sensing proxy, but with the addition of a string table of valid method names. Thus, a generic call would look up the name in the table, reject it if not listed. If it is listed, it would build a proxy function and then pass whatever parameters you pass, on the REPL, and mirror the exception at the MicroPython end back at the host side as a similar exception. This would mean anyone could just add new function names to the table to get an auto proxy (and we should allow for manual functions as well where we still need to do a bit of data marshalling and type cleaning aka: #30)

@whaleygeek
Copy link
Owner Author

I haven't merged this into mainline yet, just because I need to re-test all the chapters of our book before doing that.

But the motion sensor and V2 update .hex file is on this branch: https://github.com/whaleygeek/bitio/tree/newarch and if you use that bitio.hex file it should work fine on all devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant