Skip to content

asciimike/firebutton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reddit "Button" game, powered by Firebase

This repo demonstrates an easy (yes, easy, we promise) IoT game that connects a physical device to the internet via an Android app and Firebase. You'll need a Firebase application, so if you don't have a Firebase account, sign up for free right now!

This project was initially built for a tech talk entitled "Simplifying IoT with Firebase" at Droidcon London on 30 October. Slides for this talk are available here.

Hardware Needed

Phew was mostly built from parts lying around in my electronics box, but all the parts are inexpensive and redily available from your favorite online (electronics) retailer:

  1. 1x Arduino Uno R3 (any will do, though you'll have to update device_filter.xml with the PID and VID)
  2. 1x BlinkM I2C LED (datasheet)
  3. 1x 4.7kOhm resistor 4 1x Pushbutton (of your favorite variety)
  4. 6x long wires
  5. 1x breadboard
  6. 1x ping pong ball (to be used as a bulb diffuser)

Once you've got everything, wire it up like so: Fritzing wiring diagram for Button Game

Instructions:

  1. Connect Arduino Ground to Ground (BlinkM Pin 1)
  2. Connect Arduino 5V Power to Power (BlinkM Pin 2)
  3. Connect SCL (Arduino A5) to C (BlinkM Pin 4)
  4. Connect SDA (Arduino A4) to D (BlinkM Pin 3)
  5. Connect Button to Interrupt 0 (Arduino D2), add pulldown resistor, connect other side to Arduino 5V power
  6. Cut a hole in the ping pong ball (careful!) and insert it over the LED

Arduino Installation

Open the firebutton Arduino project in the Arduino IDE, and upload it to your device. This should set up everything you need.

The device responds to serial commands of the form Color:RRR;GGG;BBB\n, and will fade the LED to that RGB color.

The device produces serial commands of the form Button:1|0\n, which corresponds to whether the button is pressed or not.

App Software Installation

All of the code for the Phew App lives in FireButton. Once you're there, simply open the project in Android Studio and run on your favorite device.

You can also play with the App online via Appetize.io.

Questions, comments, contributions?

Contact me @asciimike or mcdonald at firebase dot com to learn more about Firebase, IoT, iOS development, or with any burning questions you may have!

About

Firebase powered Reddit "Button" Game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages