RISC OS And Arduino
Angel Perez (5629) 6 posts |
I am working on a little experiment later part of a computer project. A keyboard with an Arduino micro-controller as the encoder and keystrokes sent via the USB port. I like Pico, especially, because of its old-school home computer charm. The custom keyboard is to lay the foundation for a mechanical joystick to use in the games I write in BBC BASIC. The problem is that RISC OS can’t receive keystroke signals from an Arduino device. So I am thinking of alternatives like manipulating the GPIO pins and the use of the Tx/Rx pins directly on the Raspberry Pi from the Arduino. I may try out other micro controllers to “talk” to the Raspberry Pi in RISC OS. |
Tristan M. (2946) 1036 posts |
Take a look at the ATMega32U4. I ordered a couplle of boards based on them a while back. Hopefully they’ll be here soon-ish. |
Tristan M. (2946) 1036 posts |
Hi. My devices arrived recently. It seems there are already example Arduino sketches for using the ones I mentioned as a keyboard or mouse HID. The mouse one reads from a joystick wired to the uC. Looking at the examples you could achieve what you need pretty easily with the right microcontroller. I started on my notebook touchpad to USB mouse thing last night. Hardest thing is when things have been “Aduino’d” like the events variable. Give me bitfields or give me death. Hooboy. |
Angel Perez (5629) 6 posts |
Which ATMega32U4 devices are you talking about? Is it a Primo or other SAM-series Arduino board with M-series ARM Cortex processor, like the M0, M3 or M4? I was experimenting with a pair of Arduino modules; a Micro and a Nano. Both could write keystrokes to any OS on a computer except RISC OS according to my experiment findings. I was considering sending raw data to the Raspberry Pi through the USB connection by way of Serial.print() functions. |
Peter Howkins (211) 232 posts |
A couple of years ago I used an ATMega32U4 based Arduino Leonardo to create a USB keyboard out of an Acorn Electron. Using the standard Arduino Keyboard API, unfortunately it worked on every machine I plugged it into except a RISC OS based Raspberry Pi. https://www.riscosopen.org/forum/forums/11/topics/6652 If you guys get something working I’d love to see some code, as it may help fix mine :) |
Angel Perez (5629) 6 posts |
That’s it! The Raspberry Pi! What a bummer! I feel rather like I would have to use an operating system like RISC OS with something else. |
Tristan M. (2946) 1036 posts |
I just did some testing. As said, when set up as a USB keyboard RISC OS doesn’t seem to accept the characters. When working as a combo device, the mouse works but the keyboard doesn’t. I put the Logitech dongle in too because it’s a combo device that does work. I may well be wrong but I suspect something may need to be added to the USB definistions.
|
Tristan M. (2946) 1036 posts |
I kept at this. There is a way to get keyboard output using the Arduino ecosystem using an ATMega32U4. Install the HID-Project library via the library manager or GitHub. The BootKeyboard sketch works, which is a good starting point. I was able to send characters and strings to StrongED via the uC. |
Angel Perez (5629) 6 posts |
Is there actually a script at either of the sites, the GitHub repository or the in-OS library manager? You said that for the Leonardo micro controller you used BootKeyboard. Is that last one part of the Arduino keyboard interface library? But there is a catch in my case: I have a custom, ultra-compact keyboard layout in the works, which works like one of Adafruit’s handheld mini keyboards. But instead of a “pocket” keyboard, the keyboard design I have under construction has full-sized typewriter-type Cherry MX-series switches and changeable key caps. In the case of the Logitech devices, especially keyboards and mice, can you figure out what USB communication protocol these devices run on? |