USB Biofeedback Game Controller

 by Gundanium
Contest WinnerFeatured

Step 13: Upload keyboard sketch to your Arduino

ArduinoLogo_0.png
Now, we'll work on turning your Arduino UNO into a HID keyboard.

First, Download the zipped Arduino project from our Google Docs page.

Then unzip, compile and upload the sketch to your Arduino.

This is the code that, if desired, you would modify the threshold value in to adjust the "button" sensitivity.
 
Remove these adsRemove these ads by Signing Up
elzurdo86 says: May 9, 2012. 6:49 PM
Hi , I got it to funciton but only until the third phase, the fourth one is still not working. I will post my advance later today to show you what im doing to see if you can give me a hand, also I was trying to upload the NES EMG files but it does not let me it shows as a pde and it has problems with a boolean type of variable. It seems like it is a processing sketch not an Arduino one. Also I was checking the steps to updgrade the firmware. Is it mandatory to do it? by doing that would I be able to upload the .pde file to the arduino?

I will wait for your reply. Thanks
Gundanium (author) in reply to elzurdo86May 9, 2012. 12:06 PM
Hi,

What version of Arduino's software are you using? This sketch won't work for the new release, v1.0. They moved some header files around. If I find time, I'll work on updating the sketches.

.pde was used by previous arduino files as well as processing files.

I'm not sure I understand what you are talking about in regards to the firmware.
elzurdo86 in reply to GundaniumMay 10, 2012. 8:46 AM
I-m using the Arduino UNO R3 which is different than the one in the link you posted. I haven't tried to update the firmware in this one since the pictures in the link does not match with the one that I have.
Gundanium (author) in reply to elzurdo86May 10, 2012. 11:12 AM
Are you talking about the Arduino hardware firmware? You shouldn't have to update the hardware firmware.

The Arduino development software has changed since I posted these instructions. The hardware firmware should be the same.
elzurdo86 in reply to GundaniumMay 10, 2012. 12:10 PM
So basically I just have to update the sketch for the Arduino and I should be good to go?. How do I set up the keyboard to play the nes game? . Is a special game? or can I download any NES emulator?
elzurdo86 says: Mar 6, 2012. 3:45 PM
Hello, I'm trying to get this project going, but I'm not able to get anything from the sensors, I made this one with the arduino UNO, and I noticed that the one you have was perhaps a duemilanove? , I tried to compile and Arduino displayed the message, BYTE keyword no longer supported , instead use Serial.write. I changed all of the commands and the program didn't show any mistakes but after uploading everything to Arduino nothing happened. Can you give me a hand with this?
Gundanium (author) in reply to elzurdo86Apr 9, 2012. 6:10 AM
I've updated the Arduino and Processing code used to visualize the sensor output with the new Arduino code base. Let me know if you have any problems with it.
Gundanium (author) in reply to elzurdo86Mar 6, 2012. 4:15 PM
Nope the one I used was an UNO. They've updated the code syntax since this instructable was posted. From my quick google search, it looks like you were on the right track with replacing all .print with .write.

http://www.engblaze.com/changes-in-the-arduino-1-0-release/

I'll update the code when i can find some time.

You might want to look into grabbing an oscilloscope to debug your circuits. This is the first tool I always use prior to hooking things up to a MCU.
elzurdo86 in reply to GundaniumMar 6, 2012. 4:38 PM
Yes That is what I'm thinking. I will look for one and then post my results, hopefully I solved the problem . I'm pretty far away to buy another one :p
I had anorhter question , would it matter if I'm only using 1 EMG sensor for the processing sketch?

Gundanium (author) in reply to elzurdo86Mar 7, 2012. 6:18 AM
No it shouldn't matter. You might want to ground the unused analog pins on your Arduino tho. Their values will float otherwise.
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!