/dice_arduino

servo motor through arduino based on input of dice web app

Primary LanguageJavaScript

Make Arduino Dice Robot

Arduino controlling servo motor with dice animating web app

What you need in things

  1. Arduino inventor kit (available in Amazon, Sparkfun)
  • Arduino Uno
  • Servo motor
  • Small jumper cable
  • Breadboard
  1. Cardboard, Stick for arm

  2. Computer to run a webserver

What you need in software

  1. virtualenv for Python environment setup
  2. Code from this repo

Servo Setup

https://learn.sparkfun.com/tutorials/sik-experiment-guide-for-arduino---v32/experiment-8-driving-a-servo-motor

Install and Run

  1. Create a virtualenv (For more info, go to http://virtualenv.org)
  2. In the newly created virtualenv env (meaning after source $env_folder$/bin/activate), git clone https://github.com/imju/dice_arduino.git
  3. Run 'pip install requirements.txt' to install Flask and PySerial
  4. Open Arduino editor for arduino/servo.ino and upload to arduino (Note down the port!)
  5. Update port information in move.py in the following line with your port
  • ser = serial.Serial('/dev/cu.usbmodem1421', 9600, timeout=5)
  1. Run 'python hello.py'
  2. Go to http://127.0.0.1:5000
  3. 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