USB Biofeedback Game Controller

 by Gundanium
Contest WinnerFeatured

Step 12: Upload visualization sketch to your Arduino

processing.png
DSC01449.JPG
By this point, your USB Biofeedback Game Controller should be completely assembled and hooked up. Before we go any further, we'll need to test out your muscle sensors to make sure everything is setup properly. 

To test your setup, we're going to use the same visualization software as we used in our muscle sensor demo video. If you haven't already, download and install both the Arduino and Processing software.

Next, download and unzip the visualization program files: Arduino, Processing. Open the Arduino sketch and upload it to your UNO. If you're new to Arduino, check out the information on Arduino's website to help you on this step. Once uploaded, plug in the wall adapter to the barrel jack to power up your muscle sensors.

Next, open the Processing sketch and hit the Run button in the top left. Another window will pop up with 6 colored bars on it. Flex your right forearm, left forearm, right bicep, and left bicep and watch the bars move accordingly. If while at rest, your sensors value is below or above 150 then adjust the gain of your sensor using a screwdriver and turning the poteniometer on the corresponding sensor so that they are around 150 at rest. 

As you flex each muscle, the bars should move past the 300 mark. This is important since the software to follow uses the 300 mark to trigger a "button press". You can adjust the gain of your sensor and this threshold level in the code to fine tune your desired button press sensitivity.

Once everything appears to be in working order, close out Processing and you're ready to hack your Arduino into a keyboard.


 
Remove these adsRemove these ads by Signing Up
wan xi says: Apr 10, 2013. 9:42 PM
hello,,im having problem with Processing sketch.when i hit the Run button the window don't pop up.It show error..it said java.lang.ArrayIndexOutOfBoundsException: 1...WARNING: RXTX Version mismatch
Jar version = RXTX-2.2pre1
native lib Version = RXTX-2.2pre2
Exception in thread "main" java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 1
at processing.core.PApplet.runSketch(Unknown Source)
at processing.core.PApplet.main(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at sketch_apr11a.(sketch_apr11a.java:55)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
... 2 more

...can help me.I am new with this software....
wan xi says: Apr 10, 2013. 9:38 PM
hello,,im having problem with Processing sketch.when i hit the Run button the window don't pop up.It show error..it said java.lang.ArrayIndexOutOfBoundsException: 1......can help me.I am new with this software
Capturea.JPGCapturea.JPG
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!