whaleygeek / bitio

A micro:bit I/O device library for Python
Other
92 stars 31 forks source link

Additional services required - including GPIO #12

Open whaleygeek opened 7 years ago

whaleygeek commented 7 years ago

I might add these in before final book release. They are not needed for the book, but could form part of a useful extension when users look up the standard microbit MicroPython API's

digital_read digital_write analog_read analog_write

whaleygeek commented 7 years ago

Could be solved with a generic REPL generator?

This would mean that dir(microbit) would not be representative, and errors in naming method calls or parameters would generate runtime REPL errors, and some constants might be missing. But as a fallback, calling microbit.xx(y, z, a=1, b=2) could use __getattr__ to dynamically create a command string that it sends to the raw REPL.

It might be a special mode we enable to allow others to use existing micro:bit services, before they are written as static methods (thus fostering faster innovation in the communities).