Week Fifteen: Interface and Application Programming
Goal
write an application that interfaces with an input &/or output device
Week Fifteen: Interface and Application Programming
- Design an input device
- Make an Arduino
- Program the Arduino in something (Sketch) and the interface in something else (Processing)
Design an input device
I made a nintendo style capacitive sense game controller and an interface function to test the buttons. I made an interface to check each port to see if the computer was receive the data.
Started out making the next human interface for the game controller. As you can see in the picture the interface has 8 capacitive sensors. I modified the previous version by enlarging the footprint, spreading out the keys so my son can get his thumbs to the buttons. Also, I rotated the buttons on left so the interface can have up, down, left, and right capability.
Make an Arduino
To make an Arduino I used modified version of the FabLeo from Johnathan Grinham HERE. However, I did not have all the pieces and need to order some capacitors and resistors. I plan to use the Fab Leo in my game controller. Examples to date (Wednesday May 14th) at uploaded to an Arduino Leonardo. I am currently making one but parts did not get ordered in time.
Program the Arduino in something and the interface in something else
I decide to use Arduino and Processing for the language of choice this week. I choice Arduino because the libraries are extensive and have Keyboard libraries, which are needed for my final project. There was no rhyme or reason to chose Processing.
At first, I went through a couple of tutorials in processing which were relatively easy. However, when I started to read the serial port with the program I received and error.
WARNING: RXTX Version mismatch Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
It took me over an hour to get rid of the error. I read about 5 different forums reading all different solutions. What worked was
1st itteration
The first itteration was to just get one of the capacitive sensors to interact with processing. The way the program works is touch the cap sensor and the squar changes color. This task was completed, however, there was a major jitter. So onto the next itteration.
2nd itteration
The second itteration I got rid of the jitter and got one of the capactive sensors to work. However, now was the time to emulate the game controller.
3rd itteration
Got two buttons to work
4th itteration
Read a two total of three buttons, was not able to get good results for a fourth and needs some work. However, I did set out to do what I wanted to.
Below is a video of the Cap sensor and the interface interfacing. Whot Who!!!
Need to look into a schmidt trigger having two thresholds.
https://plus.google.com/102037206912134538785/posts
Below this I did after week. I was not satsified with the above itteration.
Same basic concept. I wanted an interface to test the game controller without have to listen to the Mario Sound and not have to start the game ever time. Know don't get me wrong I love Super Mario Brothers but while developing the controller I have been playing it non-stop and it is getting supper annoying.
The interface mimicks the game controller. When the right circlar button is pressed on the game controller the interface turns the circle black until another button is pressed.
In the case there is "The Little Bro Fab Leo" (TLBFL). To see more information about the game controller please visit the project page. Testing it.
In order to test the interface with the controller I recruited some help from my daughter. She was happy to do it for a bit although she negotiated a game of Go Fish 10s. Which, I would have played anyway.
Files
Controller - to be uploaded to the "TLBFL" and the computer needs to be grounded for it to work.
Interface - to be run from computer
Processing Examples
- http://fabacademy.org/archives/2013/students/niespielak.anna/12-interface-application-programming-1.html
- http://fabacademy.org/archives/2013/students/carter.chris/fablablog/week12/fablablogweek12.html#
- http://www.processing.org/examples/regularpolygon.html
- http://academy.cba.mit.edu/2013/students/sukhotsky.dmitry/m328%20devboard.html
Processing Arduino Library
- http://playground.arduino.cc/Interfacing/Processing
RXTX Mismatch Error
- http://blog.prossel.info/111-processing-error-warning-rxtx-version-mismatch/
- http://www.sundh.com/blog/2011/05/get-processing-and-arduino-to-talk/
- 013 Fab Charlotte.