ytram99
Posts: 29
Joined: Thu Dec 13, 2012 9:07 pm

Arduino Leonardo Mouse Move Functions on the Gertboard

Mon Jun 23, 2014 6:48 pm

Is it possible to implement mouse move functions (Mouse.begin() for example) on the Gertboard such as is done with the Arduino Leonardo? Is there a library to do that? Thanks

User avatar
panik
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: Arduino Leonardo Mouse Move Functions on the Gertboard

Wed Jun 25, 2014 9:50 am

The Arduino Leonardo uses the ATmega32U4, which has circuitry on board that handles USB (device) functionality such as mouse and/or keyboard (when you bypass the Arduino library all sorts of USB devices are possible, such as joysticks, midi, virtual serial, audio in/out etcetera).

The ATmega328 on the 'standard' Arduino and Gertboard unfortunately doesn't have that circuitry in the chip.

There are software solutions available though. Most used is the obdev USB stack. It works surprisingly well: http://obdev.at/products/vusb/index.html

I'm not sure how easy it is to compile it with the Arduino IDE. You may have to resort to a good old makefile to compile and upload it (let us know if you run into trouble with that, should be an easy fix).

ytram99
Posts: 29
Joined: Thu Dec 13, 2012 9:07 pm

Re: Arduino Leonardo Mouse Move Functions on the Gertboard

Wed Jun 25, 2014 12:13 pm

Thanks, that link gives me a good place to start.

User avatar
panik
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: Arduino Leonardo Mouse Move Functions on the Gertboard

Sat Jul 05, 2014 2:00 am

Speaking of implementing a USB HID mouse on a microcontroller; the STM32 board for the Pi that I'm making (see topic here: http://www.raspberrypi.org/forums/viewt ... 45&t=80726) has a working example of exactly that. Courtesy of the 'libopencm3' library.

Hook up 8 buttons for move-left, move-up, move-right, move-down, left-click, right-click, wheel-up, wheel-down (which reminds me to look into wheel-click for button number 9).

But if you want to control it with the Raspberry Pi over the serial port, or with sensors, or both, nobody's stopping you.

I'm just sayin' :D
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")
http://www.onandoffables.com

Return to “Add-ons”

Who is online

Users browsing this forum: No registered users and 4 guests