Pinball-MoonMakers -> Launch experiment
Pinball-MoonMakers in a game that works in the browser, where we use our Arduino Nano 33 BLE Sense, as a command to control the imposition of our ball thanks to AI.
It is a project developed for the TensorFlow Microcontroller Challenge, to create them we used standard web technologies (HTML, CSS and Javascript), matter.js, p5.js, Arduino Sense 33 BLE, TensorFlow Lite for microcontrollers,
The project is divided into three stages:
- Learning model:
- Take accelerometer data.
- Design the learning model.
- Arduino:
- Export the model as a library and add it to the arduino IDE.
- Enable the BLE connection, to send information from our pairing model to the computer.
- Web:
- Let the browser detect our arduino and establish a connection. note: takes a few seconds to connect
- We give gravity to our ball, we detect collisions, to give us points and take our lives.
- Linux, MacOS or Windows computer with Chrome installed.
- Arduino Nano BLE Sense 33.
- Micro USB cable.
- Joy-con template.
- [Optional] Battery.
- WEB.
-
You can go to the link, and play from your browser.
-
If you want to download the code, you will need to use a local server, you can use:
- Using the Live Server extension for VS Code we can easily run a development web server for any local folder.
- Node http-server: In the terminal type:
npm install -g http-server
From then on just cd to the folder that has the files you want to serve and type.
browser-sync start --server -f -w
- Node browser-sync:
In the terminal type:
npm install -g browser-sync
From then on just cd to the folder that has the files you want to serve and type.
http-server
- Arduino
-
Install the Arduino IDE.
-
Setup Arduino board:
-
Install the board by navigating to Tools > Board > Boards Manager and search for Arduino Mbed OS Nano Boards.
-
After the board is installed, select it under to Tools > Board > Arduino Mbed OS Nano Boards > Arduino Nano 33 BLE.
-
Select the port by navigating to Tools -> Port -> dev/cu... (Arduino Nano 33 BLE).
-
-
Install Arduino libraries.
- Navigate to Tools > Manage Libraries.
- Search for and install:
- Arduino_LSM9DS1.
- ArduinoBLE.
- Arduino_TensorFlowLite.
-
Open the sketch and flash.
- Download the Pinball-MoonMakers.ino
- Click the Right arrow in the top left corner to build and upload the sketch.
- Warning: This process may take a few minutes. Also, warnings may populate but the upload should still succeed in spite of them.
-