I made a project with machine learning and micro:bit.
The tools I use here is p5.js, ml5.js and MakeCode. They are all "user friendly" tools for learning to code and to use AI.
This project uses ml5.js library for Sound Classification. I used the "SpeechCommands18w" which can recognize "the ten digits from "zero" to "nine", "up", "down", "left", "right", "go", "stop", "yes", "no".
I wanted my veichle to move forvard, backvard, left, right and to stop so I ended up with using go, down, left, right and stop as my keywords.
The veichle is built from a 3D printed chassi that I drew in SketchUp. The.stl files are available at Thingiverse
The veichle uses two servo motors 360°, two wheels and a glass marble in the front.
The micro:bit I used is version 1.
With JavaScript code the micro:bit is connected to the computer over Bluetooth and when I say any of the keywords the computer sends a string value to micro:bit. Micro:bit is coded via MakeCode. I used the extension Bluetooth.
The code I used for the micro:bit:
For the rest of the code I used Visual Studio code. There is an editor for p5.js but you can not trigger Bluetooth connections from iFrames (such as in the p5 editor).
The HTML, CSS and JavaScript code can be found under attachments.
Comments