I'm building a library to allow Adafruit's CLUE and ElecFreak's micro:bit Smart Cutebot to communicate while maintaining all the functionality of the CLUE, except for the touch features. The goal is to set up a series of easy to do activities to help young coders learn to program python. I am a teacher of young learns and as such the code was purposefully left simple so I can use it with them.
Components
1×
Adafruit CLUE - nRF52840 Express with Bluetooth LE
A sensor-packed development board with the same size and shape of BBC micro:bit.
1×
Lithium Ion Polymer Battery - 3.7v 500mAh
1×
ElecFreaks micro:bit Smart Cutebot
Cutebot is a rear-drive smart car driven by dual high speed motors. I is designed to work with the micro:bit.
Use the Elecfreaks cutebot's ultrasound distance sensor and the Adafruit CLUE's proximity sensor to avoid objects. The cutebot's neopixels display the current action state.
Neopixel Color
Sensor
Action
green
Ultrasound
going forward
yellow
Ultrasound
avoiding an object between 20 to 50 centimeters away
red
Ultrasound
avoiding an object 20 centimeters or less away
blue
Proximity
avoiding an object seen by the proximity sensor
-
You can find the code for this demo in the "Example" folder of the CircuitPython_CLUE_Cutebot repository.
I added a nifty startup menu to make the Adafruit CLUE multi-functional. You no longer bounded to one program or need to rename your files to code or main to run them. Simply drag and drop your files into your CIRCUITPY drive and this menu program does the rest.
I compiled the Python files to reduce their memory allocation. The precompiled files are a quarter to a third the size of the originals Python files. This could cause problems when using the CircuitPython_CLUE_Menu GitHub repository.
The first version is up and ready! The biggest problem was, CircuitPython doesn't have an easy way to change the i2c clock speed without causing a bunch of problems. ElecFreaks' Cutebot is designed to use a 100KHz i2c clock speed while the Adafruit CLUE is designed to use a 400KHz i2c clock speed. Luckily the CLUE's i2c sensors work just fine at the slower speed. The work around was creating a new clue library that requested the lower clock speed and then shared it with the cutebot library. When importing the clue library, you have to import it through the cutebot library.