Quantcast
Channel: SparkFun Tutorials
Viewing all articles
Browse latest Browse all 1123

BadgerHack: Gaming Add-On Kit

$
0
0

BadgerHack: Gaming Add-On Kit a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t473

Introduction

The BadgerStick that you received by visiting a SparkFun booth at one of the various events we’ve attended can be hacked to perform a wide variety of tasks. The display may be small (don’t get your hopes up of running Doom on an 8x7 monochrome display). However, we can use it to display information and even play some basic games.

BadgerHack

This tutorial will guide you through turning your BadgerStick into a micro gaming system. Remember the game Breakout? Let’s make a Breakout clone on our BadgerStick by adding a joystick and some buttons!

Breakout on the Badger

NOTE: The BadgerStick and RedStick are two different products. The BadgerStick (aka BadgerHack) originated as an event-only platform to aid SparkFun in teaching soldering and programming at events like Maker local Faires and SXSW. The RedStick evolved from that concept and is the retail version of the BadgerStick, available for sale on SparkFun.com. All of the BadgerStick tutorials and expansion kits are compatible with both the BadgerStick and the RedStick, unless otherwise stated.

Required Materials

We will need a few other components to make a simple controller for the BadgerStick.


Heads up! At the time of this writing, the LED Matrix is only available at events where SparkFun is hosting workshops. For those who wish to follow along with their ReStick, a compatible version of the LED matrix will be available for sale on the SparkFun website in the near future.

Suggested Reading

Before starting this tutorial, we highly recommend you work through the main BadgerHack guide first.

BadgerHack

September 23, 2015

This tutorial shows users how to solder their SparkFun interactive badges as well as put them to use in other projects.

Additionally, if you are new to soldering or electronics, we recommend you check out the following:

When you are ready to start hacking your badge, we definitely recommend reading:

Hardware Hookup

To begin, snap off 15 pins from the break-away headers, and solder them to the through-holes on the side opposite the LED array of the BadgerStick.

Solder pins to the BadgerStick

Solder the Thumb Joystick to the Thumb Joystick Breakout board.

Solder joystick to breakout board

Snap off 5 pins from the break-away headers, and solder them to the through-holes on the Joystick Breakout Board.

Solder pins to joystick breakout board

Connections

Place the BadgerStick in the breadboard with pin 10 in position i13 and pin 5V in position i27.

Connect the rest of the components as follows:

ComponentBreadboard
Thumb Joystick Breakout*i7 (VCC)i6 (VERT)i5 (HOR)i3 (GND)
Pushbuttonc20c22f20f22
Pushbuttonc28c30f28f30
Jumper Wire( - )g30
Jumper Wire( - )g25
Jumper Wire( - )g22
Jumper Wire( - )j3
Jumper Wirej7g23
Jumper Wirej6g18
Jumper Wirej5g17
Jumper Wireg21g28

* Pins not listed are not used.


Gaming Badger Fritzing diagram

Wire colors correspond to the colors of the table above.

IMPORTANT: You can leave the battery pack soldered into the BadgerStick if you desire. If you remove the battery pack, you will need to supply power through another means, such as a USB port or a USB extension cable.

You should now have a makeshift game controller with a tiny LED screen!

Gaming badger with batteries

The Code

Plug the USB side of your BadgerStick into your computer. Make sure “BadgerStick” and the associated COM port are selected in the window below. Click “Run on Arduino.”

Play

Once the sketch has been uploaded, prepare to play!

Use the joystick to move the paddle back and forth to bounce the ball. You win when you “break” all the lights on the top part of the screen. You lose if you let the ball go past your paddle.

Let's play Breakout!

Resources and Going Further

You might notice that we do not use the 2 buttons in the game. Breakout only requires a joystick. However, you now have a basic platform that is perfect for creating games!

What other games would you want to make? Here are some ideas:

If you make something cool with your Badger, share it with #BadgerHack, or create a tutorial on hackster.io.

Resources

Other BadgerHack Projects

Check out some of the other things you can make with the Badger:

New!

BadgerHack: Sensor Add-On Kit

February 16, 2016

Turn your Badger or Redstick into a temperature and soil moisture sensing display with the BadgerHack Sensor Add-On Kit


learn.sparkfun.com |CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado


Viewing all articles
Browse latest Browse all 1123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>