Step 12: Upload visualization sketch to your Arduino
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 ads by
Signing Up


















































Visit Our Store »
Go Pro Today »




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....