RythmCubes is a game that uses your webcam and any magenta-colored object as your controller. You can add an Arduino with a motion sensor to it for an extra game mechanic.
You can play the version just with the camera here
- You'll need the MPU-9250 motion sensor with the following pin configuration:
MPU-9250 | Arduino Uno | Arduino Mega |
---|---|---|
VCC | 3,3v | 3,3v |
GND | GND | GND |
SCL | SCL | A5 |
SDA | SDA | A4 |
-
Upload the sketch in /arduino-sketches/sketch.ino
2.1. Write down the name of the port your Arduino is connected to. On macOS it's usually something like /dev/usbmodem and on Windows COM
2.2. Make sure you close the serial console in the Arduino IDE -
Change the first line in /assets/config.js from
var useMotionSensor = false
tovar useMotionSensor = true
-
Install node.js dependencies with
npm install
-
Start the server with
node server.js <SerialportName>
. For examplenode server.js /dev/cu.usbmodem1411
-
Open localhost:8081