Programming the micro:bit IO-pins wit App Inventor

691 views
Skip to first unread message

WebAtelier- mt

unread,
Nov 13, 2017, 8:10:24 AM11/13/17
to MIT App Inventor Forum

Is there any example on how it works with the micro:bit IO-pins together with app inventor?



Thanks a lot.

Farzeen Harunani

unread,
Nov 13, 2017, 9:19:30 AM11/13/17
to MIT App Inventor Forum
Hi,
It's currently not easy to use, and we're actively developing a better extension that is user-friendly and reliable. Also, we're developing better documentation.
We'll keep you posted. 
Farzeen

WebAtelier- mt

unread,
Nov 13, 2017, 9:34:34 AM11/13/17
to MIT App Inventor Forum
OK, but do you know a page with some simple examples?

It's important for me, because I want to teach at schools using AI and micro:bit.
For the normal things like bluetooth, temperature accelero and so on, it's no problem. But I don't know how to send the IO signals.
From micro:bit I only got the answer that they don't support the extension because it's third party.

WebAtelier- mt

unread,
Nov 15, 2017, 5:07:01 AM11/15/17
to MIT App Inventor Forum
??? Can someone help me with that issue?

Evan Patton

unread,
Nov 15, 2017, 9:49:45 AM11/15/17
to MIT App Inventor Forum
The most relevant document that exists right now is the Bluetooth profile that describes the micro:bit BLE functionality. Below is a summary of the relevant portions:

There are three relevant characteristics: Pin AD, Pin IO, and Pin. Pin AD is a 19-bit number that controls whether a pin is analog (1) or digital (0). Pin IO is similar in structure, except it controls input (1) or output (0). Therefore, if you want to write an analog value on pin 3, you have to set pins 3 of both characteristics to 1. Once you've written these two characteristics, you can then write the Pins characteristic with a (pin, value) pair where value is in [0, 1] or [0, 255] depending on whether the pin is configured for digital or analog. If you are doing a read operation, reading the characteristic will return bytes corresponding to (key, value) pairs for only those pins that have changed since the last read operation.

I've written a sample project that demonstrates some of the functionality. Due to the way the data are packed, there is a lot of bit-level manipulation that needs to occur and there are helper functions in the project to do this. Our team is also working on designing a better level of abstraction beyond the raw BLE interface provided by micro:bit to make the I/O pin extension easier to use.

Regards,
Evan

WebAtelier- mt

unread,
Nov 15, 2017, 11:25:14 AM11/15/17
to MIT App Inventor Forum
Thanks a lot!
So now, at least, I can do some tests to prepare my school objects.
Reply all
Reply to author
Forward
0 new messages