Digistump Forums
The Digispark => Digispark Projects => Topic started by: RussNelson on August 17, 2012, 05:16:59 pm
-
I get the impression that the Digispark allows a device to identify on USB as an HID device ... keyboard or mouse. If so, I have an awesome project: a presence detector. Hook up a PIR sensor (such as Sparkfun sells) to a single pin, and bump the mouse a tiny bit whenever it sees movement.
-
You can use V-USB to do any kind of HID stuff you want on an AVR: http://www.obdev.at/products/vusb/index.html
Mice are easily possible.
-
The included DigiKeyboard library could work for that. I just finished writing the code to emulate a joystick (and posted on this forum), but I haven\'t looked into a mouse yet. I may do that next.
-
There is some great code out there for vusb mouse emulation, we\'ll port it to a library when we have a chance, unless someone else gets there first.
Some good resources to work from:
http://www.ruinelli.ch/how-to-use-v-usb-on-an-attiny85
http://codeandlife.com/2012/02/04/avr-attiny-usb-tutorial-part-4/
-
@Russ - for your specific application you could also just use the keyboard library and have it press something like shift or cntrl - so as to not disrupt anything.
-
I have mouse working. Tomorrow, I\'ll clean it up and post it.
-
awesome - I\'ll check it out when you post it and then add joystick and mouse libraries at the same time