Earlier today I received my first shipment from Sparkfun. It contained the joysticks and buttons that I included in my previous post. The motors that I ordered won’t arrive until next week. So I decided to start by testing out the components for my cat toy controller, all of which have arrived.
I started by soldering wires to all the buttons and joysticks. I used my trusty new soldering machine along with an impromptu helping hands device, fashioned out of pieces of a styrofoam-like material. Since I enjoy learning how to solder this was a great opportunity to practice.
After soldering the components I assembled them on a breadboard. This exercise made it clear to me that I will likely need to use both of my Arduinos in this project – one for the toy itself, the other for the controller. I hadn’t given it much thought but originally I had planned to use only one Arduino (I can always consider using a multiplexer). That said, I like how by using two Arduinos it will be easier to add wireless functionality to this toy in the future.
While hooking up the components I discovered that the arcade-like joystick uses switches rather than potentiometers. Therefore, it has a limited resolution that is digital-like, which can only differentiate between nine different orientations; unlike the potentiometer-based joysticks that can differentiate between thousands of precise positions. It was designed for games like pacman, with more limited input requirements. It should work fine for my project (if it doesn’t I have a second thumb joystick as a back-up).
In regards to the other joystick, I noticed after setting it up that Sparkfun sells an inexpensive breakout board. I am considering purchasing this component because it will make it easier for me to mount the joystick in the controller. It also reduces the number of pins to 5 (from 10), which will help me minimize the wiring complexity.
After setting up the circuit I developed a short Arduino sketch that tests each component. This simple application reads input from each button and joysticks and writes their current state to the serial port. I created this sketch mindfully so that it can serve as the foundation for the final code.
Here is a brief overview of the next steps I need to take:
Design the box for the controller
Check connection with infrared sensor
Find cat scratching post that can serve as basis for the toy
Look at gears to move laser and arm
Tuesday, November 24, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment