Arduino controlling servo motor with dice animating web app
- Arduino inventor kit (available in Amazon, Sparkfun)
- Arduino Uno
- Servo motor
- Small jumper cable
- Breadboard
-
Cardboard, Stick for arm
-
Computer to run a webserver
- virtualenv for Python environment setup
- Code from this repo
- Create a virtualenv (For more info, go to http://virtualenv.org)
- In the newly created virtualenv env (meaning after source
$env_folder$ /bin/activate), git clone https://github.com/imju/dice_arduino.git - Run 'pip install requirements.txt' to install Flask and PySerial
- Open Arduino editor for arduino/servo.ino and upload to arduino (Note down the port!)
- Update port information in move.py in the following line with your port
- ser = serial.Serial('/dev/cu.usbmodem1421', 9600, timeout=5)
- Run 'python hello.py'
- Go to http://127.0.0.1:5000
- Have fun! ( Currently supports single dice up to 6 digits)
Demo at https://youtu.be/zqtqyddbNbw
Credit: Dice program is from Anton Natarov for details http://www.teall.info/2014/01/online-3d-dice-roller.html