Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Programming Questions / Re: Leonardo keyboard leds emulation? on: March 06, 2014, 02:45:09 am
I'm attaching the patched files resulting of applying usb_key_leds.diff to arduino version 1.0.5

Not tested it yet.
2  Using Arduino / Programming Questions / Re: Leonardo keyboard leds emulation? on: March 05, 2014, 12:11:50 pm
A patch file is a file that indicates how to modify a given source code (or any text file) to obtain a new one with some changes.

Essentialy, a patch file contains data indicating something like "add this line, remove that one, etc.". It is generated by the unix command "diff" that compares two files and responds with this data. Having the patch file and the original file, one can use the command "patch" to obtain the modified version.

[edit] (found the patch file). I am applying it:
# cd /usr/share/arduino/hardware
# patch -p2 </home/anv/Descargas/usb_key_leds.diff
patching file arduino/cores/arduino/HID.cpp
patching file arduino/cores/arduino/USBAPI.h
Hunk #1 succeeded at 111 (offset -1 lines).
Hunk #2 succeeded at 131 (offset -1 lines).
Hunk #3 succeeded at 140 (offset -1 lines).

I'm attaching the result files
3  Using Arduino / Programming Questions / Lonardo ENTER vs. NUMPAD ENTER on: September 08, 2013, 03:40:11 am
A am trying to create a simple program for sending texts to the PS3 using keyboard emulation of Leonardo.

It works but the ENTER key is not accepted by the console. I tryed with a real usb keyboard and the enter key in numeric keypad is not accepted by the console. Then, I must asume that Leonardo libraries are sending this key instead of the normal enter key.

I see in the code that KEY_RETURN is defined as 0xB0 but I checks the documentation about scancodes in internet (like http://www.quadibloc.com/comp/scan.htm) and the codes are very different, then I understand that throug usb the codes sent are different: i.e. The scancode for F1 is 07 but the key definitions in arduino's USBAPI.h says #define KEY_F1 0xC2

Any help please on finding the right code or locating the problem with the PS3?

Update: I found this http://www.mindrunway.ru/IgorPlHex/USBKeyScan.pdf but it says KP Enter is 58 and normal Enter is 28, but USBApi.h indicates KEY_RETURN=0xb0.


4  Using Arduino / Installation & Troubleshooting / Re: Arduino RPM for Mageia 3 on: August 05, 2013, 09:20:15 am
I'll have to check with Mageia community to fix it for the M4 version.

It is possible to create a working mageia packet up from sources, but there are many problems on this. I.E. I found that avr-gcc 4.3 compiled from the sources can't create binaries for arduino leonardo. I asked the Arduino people for the exact pathces they are using but they answered me that they are using the Ubuntu binaries.

Then, I decided to create an rpm packet containing the official binaries with a few changes. Tis is a dirty solution that Mageia comunity will reject to use. Then, I think they will continue with the same sources as in Mageia 2 that were reported not working.
5  Using Arduino / Programming Questions / Re: Leonardo keyboard leds emulation? on: June 23, 2013, 09:46:54 am
Quote
Then, the keyboad chip must be able to receive controls from the PC... what seems to be lacking in Arduino HID implementation...
It's open source. Quit whining and add it, if you need it.
Of corse, just now I am checking the code. But first I wanted to ask if there where some way of doing it without modifying the libraries.
6  Using Arduino / Programming Questions / Re: Leonardo keyboard leds emulation? on: June 23, 2013, 09:10:15 am
Your original posting made no mention of a second keyboard, only the one being emulated by the Leonardo, hence the comment that as you were setting the Shift lock/Num lock status using the Arduino you had sent the status to the PC and did not need to receive it back.

It does not matter how-many keyboards have you connected to the PC. The system is made in a way that allows many keyboards, then, the lock status is managed by the operating system and NOT by the keyboard. Then, the leds are controlled by the PC software and NOT by the keyboard itself. When you press caps lock, it does not turns on the caps lock led. The heyboard send the scan code (row/column) to the PC. The PC software changes the status of a flag and sends back to the keyboard the command for tuning on or off the led. The led status is not decided by the keyboard chip: it is completely controlled by the PC's operating system. Then, the keyboad chip must be able to receive controls from the PC... what seems to be lacking in Arduino HID implementation...
7  Using Arduino / Project Guidance / Re: Read keyboard led status on: June 23, 2013, 07:42:52 am
I have an external usb keyboard of which the status leds follow the leds of the internal keyboard of my laptop. So if I press numlock on my laptop, the numlock leds of both the laptop and the external usb keyboard light up.

I meant 'using the Arduino as a keyboard' using the Keyboard libraries (http://arduino.cc/en/Reference/MouseKeyboard) to send keypresses. I was considering building something akin to this usb-password-typer. http://ob-security.info/?p=631

So I guess catching the led status should be possible via usb, but it might indeed not be implemented in the keyboard library yet.

Did you find anything about this? I am searching for the same feature. May be we need to modify the Keyboard library at HID.cpp...
8  Using Arduino / Programming Questions / Re: Leonardo keyboard leds emulation? on: June 23, 2013, 07:31:13 am
What LED and what status are you talking about? Shift lock, num lock? If so, didn't YOU send that information to the PC?

In the very very old XT keyboards, the num lock/caps lock/scroll lock status where sent only from keyboard to PC. Xt keyboards didn't receive info from the PC. But since many years with the AT keyboards, the communication is bidirectional, then you can connect two keyboards to the PC and hitting num lock in one affects the led status in all keyboards. Then, you can change the caps/scrool/num lock statys by software and this status is shown in the leds. Remember that keyboards does not send "letters" to the PC; it sends row/column of the key. Caps lock key is only another key with it's own row/column scan code and hitting it not necessarily will cause the caps lock led to get on or off. It is controlled by software in the PC.

 
9  Using Arduino / Programming Questions / Leonardo keyboard leds emulation? on: June 23, 2013, 06:34:11 am
I am trying to create an USB keyboard controller with an Arduino Leonardo, but I can't find the way to emulate the keyboard leds. The PC sends the leds status to the keyboard but the Keyboard object on Arduino seems not to have any read function or any way to get the leds status.
10  International / Français / Re: Installation sous Mageia Linux on: June 22, 2013, 10:21:05 am
Dans ce post, vous trouverez un paquet spécialement conçu pour Mageia3. En ftp.blogdrake.net il ya aussi une version pour Mageia 2.
Please see http://forum.arduino.cc/index.php?topic=172877.0
11  International / Software / RPM de arduino para Mageia 3 (y otras distribuciones basadas en RPM) on: June 19, 2013, 03:38:30 am
Este post es para informar que está disponible un paquete RPM de Arduino para Mageia 3

El binario oficial de Arduino hecho por Mageia no funciona. A demás, magia usa vesiones nuevas de AVR-GCC que no son totalmente compatibles con los los fuentes de Arduino. Para solucionarlo he creado un nuevo paquete basado en los binarios oficiales de Arduino con unos pocos cambios (que explico al final). El paquete funciona sin problemas simplemente con instalarlo y no necesita modificar grupos o permisos ni reinicios.

Instrucciones:

Para 32 bits:

Alternativa 1 (preferible porque permite actualizaciones automáticas):

Code:
urpmi.addmedia --wget --distrib http://ftp.blogdrake.net/mageia/mageia3/i586
urpmi arduino
Alternativa 2 (instalación manual):

Code:
urpmi http://ftp.blogdrake.net/mageia/mageia3/free/i586/arduino-1.0.5-1bdk.mga3.i586.rpm
Para 64 bits:

Alternativa 1 (preferible porque permite actualizaciones automáticas):

Code:
urpmi.addmedia --wget --distrib http://ftp.blogdrake.net/mageia/mageia3/x86_64
urpmi arduino
Alternative 2 (instalación manual):

Code:
urpmi http://ftp.blogdrake.net/mageia/mageia3/free/x86_64/arduino-1.0.5-1bdk.mga3.x86_64.rpm

El paquete también está disponible en el repositorio para mageia 2 y debería funcionar en otras distribuciones basadas en RPM.

Explicación de los cambios:
  • El paquete incluye todos los binarios oficiales de Arduino para mantener máxima compatibilidad con la excepción de:
  • He reemplazado la biblioteca RXTX library con los siguientes diferencias:
    • Se ha deshabilitado el bloqueo de puertos para que no sea necesario agregar el usuario al grupo lock
    • Se ha agregado la detección de los dispositivos /dev/ttyACM y /dev/arduino devices
  • He agregado una nueva regla de udev que:
    • Asigna por defecto los permisos 666 al conectar el Arduino para evitar la necesidad de agregar el usuario al grupo dialout.
    • Se ha agregado un enlace al dispositivo con el nombre "arduiono" para que se cree automáticamente un /dev/arduino
12  Using Arduino / Installation & Troubleshooting / Arduino RPM for Mageia 3 on: June 19, 2013, 03:29:27 am
Just informing that I created an RPM packet for Mageia 3

The official Mageia binaries does not work. Also, Mageia binaries has another problem: it uses a newer version of AVR-GCC that is not compatible with all Arduino sources. Then I created a new packet based on the official binaries with a little changes. The packet "just works" and don't need to change any permissions or groups.


Instruction for usage:

For 32 bits:

Alternative 1 (better because it auto-updates with new versions):

Code:
urpmi.addmedia --wget --distrib http://ftp.blogdrake.net/mageia/mageia3/i586
urpmi arduino
Alternative 2 (manual install):

Code:
urpmi http://ftp.blogdrake.net/mageia/mageia3/free/i586/arduino-1.0.5-1bdk.mga3.i586.rpm
For 64 bits:
Alternative 1 (better because it auto-updates with new versions):

Code:
urpmi.addmedia --wget --distrib http://ftp.blogdrake.net/mageia/mageia3/x86_64
urpmi arduino
Alternative 2 (manual install):

Code:
urpmi http://ftp.blogdrake.net/mageia/mageia3/free/x86_64/arduino-1.0.5-1bdk.mga3.x86_64.rpm

The packet is also available for mageia 2 and should work in other rpm based distros.

Explanation of the changes:
  • The packet includes all the official binaries for maximum compatibility except for:
  • I replaced the RXTX library with the following changes from official binaries:
    • Disabled port locking avoiding the need of adding the user to lock group
    • Added /dev/ttyACM and /dev/arduino devices
  • I added a new udev rule that:
    • Sets the default permissions of the arduino device to 666 for avoiding the need of adding the user to dialout group.
    • Added a link to the device named arduino for auto creating the /dev/arduino device
13  Using Arduino / Installation & Troubleshooting / which avr-gcc on linux on: March 05, 2013, 04:23:00 pm
I am trying to compile binaries for arduino for creating mageia 3 rpms. I can build the arduino ide and I can compile avr-gcc without problems. But, avr-gcc version 4.3.2 and 4.3.3 does not support the atmega32u4 of leonardo. Earlier versions like 4.6.2 (which generates much smaller binaries) do but has problems with some sources (i.e. can't compile ethernet library).

I red that the binaries of arduino includes 4.3.2 but I think it must be patched to support leonardo. ¿Where can I found that patch and/or instructions for compiling the right avr-gcc?

14  Using Arduino / Programming Questions / Re: Using PROGMEM data on: February 15, 2013, 09:41:35 am
Perhaps this will be fixed some day. For now it is a little inconsistant.

Ok, I understand.

But I've found stranges different results when I use F() and PSTR() in Serial.println. In a sketch that uses ethercard for tcp/ip (high memory usage), I had problems of garbage sent to Serial instead of some constant strings. I thought that PSTR was stored on flash, then it can't be modified after uploading the program. Then, I suppose PSTR is copying the string to RAM or something like this. This sould not be problem but I received the garbage... Then I replaced PSTR with F and the problem was solved... but F can only be used in Serial.print and a few places, PSTR works with sprintf, strcmp, etc.
15  Using Arduino / Programming Questions / Re: Is there a function to compare two const __FlashStringHelper* strings? on: February 15, 2013, 08:47:16 am
I am investigating about this.

I'm trying to do something like this:

sprintf(buf,F("<br><br><input type='submit' value='Relay 1' class='c%d' onclick='f(1,%d)'>"),digitalRead(RELAY1),digitalRead(RELAY1));

But I receive this error:

cant convert  ‘__FlashStringHelper*’ to ‘const char*’ for argument 2 for ‘int sprintf(char*, const char*, ...)’

I've found I can do this:

sprintf_P(buf,PSTR("<br><br><input type='submit' value='Relay 1' class='c%d' onclick='f(1,%d)'>"),digitalRead(RELAY1),digitalRead(RELAY1));

But I don't know the difference between F() and PSTR(). Can't find clear documentation about this.

Pages: [1] 2 3 ... 5