Skip to content

melanieshimano/picademy-ddr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi Dance, Dance, Revolution + Twitter Bot

Looking for a fun way to learn how to use Raspberry Pi and a variety of Raspberry Pi accessories? In this tutorial, you'll learn how to use a Raspberry Pi, Sense HAT, PIR (motion) sensor, and a Raspberry Pi camera to make a Dance, Dance, Revolution game that automatically uploads a gif of your dance to Twitter. Alt text

We created this Raspberry Pi Dance, Dance, Revolution Game at Picademy Jersey City (June 2018). See the final output on Twitter here: https://twitter.com/Picademy_DDR

Overview

  • The motion sensor detects a new player, which prompts the player(s) to input their name(s) and gives directions for the game.
  • The Sense HAT displays “3, 2, 1, GO” and then give the player(s) five random directions to point their arms for the dance
  • While the player is dancing, the Raspberry Pi camera captures an image of each dance motion, then stitches these together into an animated gif and posts the final gif of the dance to the Picademy_DDR Twitter account!

Alt text

If you want to get a little more familiar with all of the Raspberry Pi accessories before starting, you can look through the following tutorials:

Raspberry Pi Camera Sense HAT PIR (motion) sensor

Materials

Prerequisites

You’ll need to install the following through the Raspberry Pi terminal:

pip install imagemagick
pip install twython

Instructions

  1. Because we need GPIO pins for both the Sense HAT and for the PIR sensor, we’ll attach the mini black hat hack3r to the GPIO pins to extend their functionality. Make sure the ribbon wire connects to the GPIO pins such that it crosses over the body of the Raspberry Pi (RPi) and connects to the row of pins outside of the dotted lines Alt text

  2. Connect the Sense HAT to the GPIO pins on the opposite side of the ribbon wire so that you still have access to the middle row of GPIO pins on the mini black hat hack3r Alt text

  3. Connect one end of the three jumper wires to the PIR sensor, and connect the other end to the open GPIO pins according to the PIR pin labels that are underneath the removeable Fresnel lens (white cap) on the PIR:

  • PIR Sensor VCC -> RPi 5V (green)
  • PIR Sensor OUT -> RPi any GPIO numbered pin (yellow, on GPIO 4)
  • PIR Sensor GND -> RPi any GPIO GND pin (orange) Alt text Alt text Alt text
  1. Connect the Raspberry Pi camera to the camera port on the Raspberry Pi such that the blue strip points toward the RPi audio jack Alt text

  2. Set up the RPi setup such that the camera, PIR sensor, and Sense HAT are at eye level—we used mounting putty to stick these on our monitor, but you can get creative and hold these up in any way that best fits your needs! Alt text

  3. Plug in the mouse, keyboard, HDMI/monitor, and power supply to the RPi to power turn on the RPi

  4. Install the packages listed in the Prerequisites section through the RPi terminal

  5. Download the code file from the Github page, unzip the file, and save the DDR_CAMERA.py and auth.py files to the same file

  6. Follow the instructions here to set up a Twitter account and get your access keys/tokens to make the Twitter bot portion of the RPi DDR game. Edit the auth.py file with your consumer key, consumer secret, access token, and access token secret information

  7. Make sure that your camera is set up at a good angle by following the Getting Started with picamera instructions if you haven’t previously worked with the RPi camera

  8. Run the DDR_Camera file, do the dance, see it post on your Twitter account, and enjoy! Alt text

About

Raspberry Pi Dance, Dance, Revolution Game created at Picademy Jersey City (June 2018)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages