Arduino Based Handheld Bluetooth Game Controller

Posted on November 23rd, 2012 in Androcade, Arduino, Projects | 5 Comments »

I’ve been on mission lately to design a handheld bluetooth game controller. I’ve made a prototype in the past but, it never was really usable as a gaming device. Although the concept worked well the form factor was not quite there.

Well after a few months of tinkering and several designs I finally have one!

The design is based around the Atmega 328 running the Arduino bootloader. There is a RN42-HID bluetooth module that allows serial communication between it and the microprocessor.

I wanted the device to be fully hackable so I designed it with headers for both the bluetooth module and the Atmega 328 chip. I can reprogram the bluetooth module to run HID keyboard or mouse (or combined), it can iterate as a gamepad, or it can reconfigured to run serial protocol and iterate as a virtual com port.

Communication with the bluetooth or the Atmega328 is done through a FTDI header allowing me to keep the board design simple.

There are a total of 12 buttons on the device including two shoulder buttons. I included LEDs to indicate power and the connectivity states of the bluetooth module.

The system runs on 3 AAA batteries that are attached to the bottom of the device.

 

It works great for both Android devices and iPhone devices. I have it iterate as a HID keyboard and then run code to simulate the iCade, since there are already a lot of games that support this protocol. I also have code that just runs simple keyboard presses and this works great in games that support keyboard input. The nice thing about it is that it can be reprogrammed easily to accommodate any protocol that I need. I have also combined the regular keyboard and the iCade protocol into one code base and switch by holding a button down at boot – multiple protocols!!

I finished off the device with a laser cut acrylic case. I wanted something that would show off the insides of the device. I think it is a great conversation started when people see the insides, they tend to get more curious when they see it is not just another game controller.

The whole device is  4.5 inches wide by 4 inches high and a little under one inch thick which makes it a nice fit for your hands and very easy to carry around.

Over the next few weeks I’ll be working on cleaning up the code and making a video to show more of the functionality, so check back soon for more bluetooth goodness!

Androcade 2.0 – Android/iPad Arcade Controller

Posted on June 6th, 2012 in Androcade, Android, Arduino, Projects | No Comments »

Well it’s been a year since I first created the original Androcade. I finally found some time over the past couple of months to create a new and, I think, better version! Introducing Androcade 2.0 and the iAndrocade (more on this one later)!!

I’ve been busy with other projects such as an Arduino based clock, a monitoring system for my son’s snake  - and of course my day job… but, my original Androcade has been sitting in my office the whole time and I’ve enjoyed more than an occasional game with it. Although it has been a reliable and fun system there was always some things about it that I wanted to change.

Read the rest of this entry »

Androcade Handheld

Posted on July 15th, 2011 in Androcade, Android, Code, Projects, Software | 2 Comments »

After making the original Androcade with real arcade controls I felt that I needed a smaller device that was a little more portable. I decided to use a joystick/button shield for prototyping this device.

Taking the same configuration I had in the original Androcade I added support to the arduino program to allow for an analog joystick to control the up/down/left/right. This was pretty straight forward, instead of triggering a serial send via a button I just looked to the value of the analog input and triggered based on thresholds.

The device is a little large at this point because of having to stack a few shields on top of each other but, it works great! The next plan would be to shrink down the prototype into something that fits into your hands. I’ve had a couple ideas – like taking an existing controller and replacing the insides with an Arduino mini but that’s left for another time.

Androcade Handheld

Read the rest of this entry »

Androcade Android Arcade Controller (PART 1)

Posted on June 29th, 2011 in Androcade, Android, Code, Projects | 11 Comments »

I vividly remember the days of putting my hard earned quarters into the latest video game at the the local arcade (Machine Shed). Disparately tying to get my initials on the high score board, hearing that familiar knock when someone got that extra game on the pinball machine…

Well it’s not the 1980′s anymore and those great games of the past have been replaced by XBox live and mobile handsets.

I’m not one to shy away from the latest in new technology, in fact, I welcome every new piece of techno-wizardry that comes my way. Although, I do miss the look of that retro-joystick and the familiar feel of the plastic button under my fingers. So out of my need to recapture some of my youth (maybe a bit of a stretch) and my love of new technology I set out to create a simple retro gaming controller for the Android platform.

Here’s a video preview of the final project:

Androcade Preview

Read the rest of this entry »

Androcade Android Arcade Controller (PART 2)

Posted on June 29th, 2011 in Androcade, Android, Code, Projects | Comments Off

In part 1 we started to introduce the ANDROCADE and I gave a little background on what I was looking for. In Part 2 I will talk a little about the software.

Writing the Software

This was the most involved piece of the entire build. I had to write essentially two different programs, one for the Arduino to interact with the buttons and one for the Android that would receive the bluetooth commands and send them out as keyboard commands.

I hate to disappoint anyone reading this but, I’m not going to get into great detail about the code and it is not publicly available – yet… I still need to clean it up and test some more before I decide what to do with it. I will however give an overview of what I did.

Interfacing with the Arduino

This is actually the simplest part. The controls are just buttons that open and close a loop to a digital pin on the Arduino. The Arduino senses the change and sends out a serial command based on which pin was triggered. Each of the buttons was connected to a digital pin via a pull up resistor. When the button is pushed the pin goes low and the software sends out a serial command based on the which pin was triggered. Here is a simple example to show what I’m talking about:

Read the rest of this entry »

Androcade Android Arcade Controller (PART 3)

Posted on June 29th, 2011 in Androcade, Android, Code, Projects | 1 Comment »

In parts 1 and 2 I talked about the concept and the software now it’s time to move on to the actual controller!

Controller Design

The next phase was to design something to house the controls. I first gravitated to building a mini-arcade cabinet. These are really cool! They are just scaled down versions of the real arcade cabinets. After toying with a few designs I wasn’t happy with the way they were turning out.

What I didn’t like about the arcade design was the fact that I wanted to use any type of android device from tablets to phones. The arcade would have to be rather large to accommodate tablets in both landscape and portrait mode but, then it would be overbearing for a phone sitting in the large cabinet.

I also wanted to convey the idea that this is an Android specific controller – I’m a big Android fan and since this was designed specifically for that platform it had to scream Android!

I sat down and tried to tap my artistic side, which is very limited by the way, and come up with a unique controller design. After a few failed attempts I hit on the idea of using the Android mascot Andy as the base for my controller. I sketched out a few designs on paper to see if the idea was viable and from what I could see on paper – I had my design!

Read the rest of this entry »

Android Monitor WiFi State With BroadcastReceiver

Posted on May 5th, 2011 in Android, Code | Comments Off

In a recent project I had to be able to monitor the state of the WiFi connection. I needed to be able to notify the user about what state the connection was in in real time.

There were three states that I was interested in notifying the users of my app about:

  1. Is WiFi available on the device
  2. Is the WiFi enabled
  3. Is the WiFi connected to an access point

One of the features in Android is the concept of listeners. These are classes that allow your app to receive and process events based on the state of something on the device. For example there are listeners that allow you to monitor GPS updates or accelerometer changes. So the off I went to search for a listener for WiFi changes… well to my surprise there is no listener for WiFi state.

Read the rest of this entry »

Get Your IP Address Android Code

Posted on April 25th, 2011 in Uncategorized | Comments Off

I recently had a need to know the IP address of my phone when it was attached to my local network. I thought that this would be easy – just use the WifiManager – right? Get the WifiInfo then call getIPAddress() and that should give me what I needed. Well I was wrong…

Read the rest of this entry »

Understanding Android Activity Life-cycle

Posted on October 25th, 2010 in Android, Code | Comments Off

When I first starting programming for the Android I was quite confused about the life-cycle of activities. It seemed almost strange how the application started, stopped, and paused without seemingly any logical reasoning. The activity would be destroyed and re-created when the screen was rotated and paused when other applications were started…

I soon learned that having a good grasp on the life-cycle of an activity was critical. Making an efficient application and knowing when to save critical data related to your activities state, let alone restoring your application to a particular state is all a part of the activity life-cycle.

There is a lot of different articles and information available on the internet about the life-cycles of activities. The Google documentation has good information on this as well. But I’m always better at understanding things if I see them for myself.

So I decided that I would write a simple activity that prints out debug statements each time one of the functions of the life-cycle was executed! Then I would be able to see exactly what is happening during each phase and when each function occurs during different situations.
Read the rest of this entry »

Paint.NET – Great Image Editing Software – Free!

Posted on October 19th, 2010 in Ramblings..., Software | Comments Off

I’ve always loved to create my own graphics for websites, videos, even the family photos. One thing that stopped me was the price of good editing software.

In my search for a great editing package I’ve come across a real gem. Paint.NET (sorry mac users – windows only) This software has everything and then some.

The interface is extremely intuitive everything is laid out simply allowing you to easily find the tools you need. It has a thumbnail interface allowing you work with multiple images.

Read the rest of this entry »

Learn about an canadian pharmacy online without prior prescription.