Is time to work with arduino, lpcXpresso not works for me!
I’m using the arduino uno board.
The usb codes of the keys, by BSD guys and this for android (I never use them)
If arduino not works in Arch:
# chmod 777 /run/lock/
Note, I try using adding my user to a root group using 755 permission but not works π¦
For the next:
Pending to do or for the next version
* Buttons without resistors using this page
First exploration, Reading all the MuuTTa-Wand buttons. (the code is not nice, is only a quick test)
Works π but I have a hardware problem with one button π¦
Reading MuTTa-Wand keys, a better code π
Detection of the first two buttons at the some time, code is not nice but works!
update using also the combination for Q key (MuuTTa-Wand Concept 1)
I think that i find the solution here for improve the code:
I love to know binary, with this code I turn on the led when I push the first or the last button:
Q W E R T keys:
Now also sending the key via serial port:
Pending solve the Linux read because “tail -f” not works, for now “cat </dev/ttyACM0"
delay(200);
I do a change, the delay now is 200 , for get one char at time because I was getting 3 or 4 times for one touch.
Now I can read using screen but after use it I can’t upload the firmware to arduino, I get this error:
For solve this problem the solution is simple:
The problem wasn’t screen
I run arduino from a terminal and I get:
The solution is not nice π¦
Now I understand screen was one problem and /run/lock permissions other!
cat /tmp/arduino.input | tr ‘\r’ ‘\n’ | tr -d ‘\n’
\r in newline in DOS
\n newline in UNIX
Now the idea is use arduino as HID USB keyboard, i find this tutorial:
http://mitchtech.net/arduino-usb-hid-keyboard/
For use as base, no I know that my arduino isn’t SMD:
http://arduino.cc/en/Main/ArduinoBoardUnoSMD and i have to sold a resistor:
http://arduino.cc/en/Hacking/DFUProgramming8U2
Voy a desconectar los pines del arduino, son:
11 10 9 8 7 6 5 4 3 2
azul verde negro naranja rojo rojo naranja negro verde azul
arduino uno
Y el blanco en la tierra
Dowloading the files:
https://github.com/arduino/Arduino/blob/master/hardware/arduino/firmwares/atmegaxxu2/arduino-usbserial/Arduino-usbserial-uno.hex
http://hunt.net.nz/users/darran/weblog/b3029/Arduino_UNO_Keyboard_HID_version_03.html
http://hunt.net.nz/users/darran/weblog/b3029/attachments/03237/Arduino-keyboard-0.3.hex
Installing the dfu programmer:
$ yaourt -S dfu-programmer
Put and remove the jumper no dejar el jumper puesto
# dfu-programmer at90usb82 erase
# dfu-programmer at90usb82 flash Arduino-usbserial-uno.hex
Validating…
4058 bytes used (99.07%)
# dfu-programmer at90usb82 reset
thanks to this post for this note:
βError parsing the line. Something went wrong with creating the memory image.β β the .hex file is damaged, re-download it
I open the IDE and put my sketch (following the guide)
I do again the process with the jumper and:
# dfu-programmer at90usb82 erase
# dfu-programmer at90usb82 flash Arduino-keyboard-0.3.hex
Validating…
4022 bytes used (98.19%)
# dfu-programmer at90usb82 reset
And f*?%k, all this only for know how works:
Testing the demo:
And Works!!!
Sin usar resistencias !!!
MuuTTa-Wand as key for down the volume:
For do more easy the programming process and remember the jumper:
as-arduino.sh (you need Arduino-usbserial-uno.hex file in the directory)
as-keyboard.sh (you need Arduino-keyboard-0.3.hex file in the directory)
Not works:
This is for connect to 5V, i need to GROUND
Reading http://arduino.cc/en/Tutorial/DigitalPins
pulldown resistor (resistor to ground)
No internal pull-down in arduino! http://www.squidoo.com/arduino-pull-down-resistors
http://www.freebsddiary.org/APC/usb_hid_usages.php
And http://code.google.com/p/androhid/wiki/Keycodes
Something is wrong with the Q combination, pending do a test, now using the W key works!!!!!
QWERT as keyboard!!! and now the code is elegant π
Alpha chars enter, space and backspace:
Pingback: The blog | MuuTTa
Changes in the codification for do it more easy: