As I have recently mentioned in some of the other threads, I have been collecting some new components to build myself a second DIY remote control. Some of the components that I have collected and their requirements include:
2 4 function Joysticks (servocity.com/html/4_function_joystick.html): 3 Analog + 1 digital each: 6A 2D
2 Sliders (mouser.com/ProductDetail/Eag … P9ug%3d%3d): 2A
1 16 button keypad (I had a different one, but will probably change to: elexp.com/cmp_1604.htm): 8D
Other switches: 4+ (can be handled by 1 D if added on to keypad logic)
XBee: 1 USART (2 D maybe 3)
1 Display (Trying an OLED like DialFonZo - sparkfun.com/products/8537): 1 U
Sound: 1D
PC connection: 1U
So I need at least: 6 Analog pins, 12 digital pins, 3 Usarts. Which does not fit on a Basic Atom Pro 28, so I decided to go with an Arduino Mega. I am using ones by SeeedStudio: seeedstudio.com/depot/seeedu … 73bf3cbf85
This gives me: 4 USARTS, 16 Analog pins, and 70 digital pins, so leaves me lots of room to experiment and add additional things like Nunchucks (Wii)… I thought about doing this with an Arc32, but I did not have any spare ones sitting around.
I have started to experiment with a rats nest of wiring and have some of the pieces in place, so far I have done the following:
Step 1: I plugged in a 4x4 keypad I had sitting around (different one made by actcomponents.com), that I ordered years ago from Digikey. I put tape over some of the keys to have the same labels as the ones that were used in the DIY. Code is working on Arduino. Easy to hook up, just used 8 digital IO pins. Did not need pull-ups as I simply enabled the ones on the Atmega1280. This now works.
Step 2: I connected up a 128x128 OLED display. Connected to USART, running at 125000 baud rate. I started off with some of DialFonZo BAP code and have it running on the Arduino. Started creating functions to do many of the simple things like display text, numbers… Got some of it working. Will add more as I need it. Will also try to abstract this out into a c++ class, such that I can have different implantations for a simple 2 line or 4 line LCD display.
Step 3: rigged up one of the 4 function joysticks. Have it connected to 3 of the analog inputs, plus 1 digital. Have analog code in place that does the averaging of the last 8 samples (like our BAP code). That part appears to be working. I have some of the centering code in place that scales the output from 0-255 and tries to make the initial centers to be 128. Still need to add the code to read the actual Mins/Maxs for each one. Note: these joysticks appear to give me good values from near 0-1023.
The following picture shows the OLED display with outputs showing the outputs for 1 joystick (Should look familiar to DialFonZo):
Step 4: I connected up an XBee using a parallax USB adapter (parallax.com/Store/Accessori … fault.aspx). I have had better luck with these on Atmega based systems than the ones from sparkfun as it does voltage conversion both directions…
Step 4a: I converted my XBee conversion program from Basic for the BAP to an Arduino sketch. Currently only working on Mega, but will add support for non-mega as well.
That is what is completed so far. My next steps will include:
-
build some form of case for these components as they currently are not very portable
This will also include something to clean up the wiring. Maybe a shield, maybe …
-
Hook up the rest of the current components (2nd joystick, sliders, speaker…)
-
Figure out what I want to display on the OLED. Will probably have a graphical battery indicator (rectangle shows how much left, maybe change color…), show the 3 joystick values for each stick plus slider (value and/or graphic). Maybe some Status areas: Text? Values? Button States? …
-
Finish porting my DIY Remote code to this new platform. Will take me awhile as I have several other projects going on as well.
That is all for now.
Thoughts?
Kurt