Go Down

Topic: Using Leonardo as mouse. How to prevent automatic driver install on Windows? (Read 1 time) previous topic - next topic



I'm using a Leonardo to do mouse control.  I'd like to be able to easily use the device to control the mouse on any computer (i.e. plug it in and it should just work) but I've found that on Windows machines you have to go through a series of prompts about Arduino driver install.  I don't need or want this; I just want the mouse to work as soon as you plug it in without any other distractions.  The prompts can be closed without affecting whether the mouse movement works, so I assume these are drivers for programming the Arduino from the Windows computer.

Is there some way to prevent these driver install prompts from coming up?



Yes, install your sketch instead of the bootloader (with an ICSP programmer). The bootloader shows itself to the host computer as a serial device to be ready for a new sketch to be uploaded. If you don't want this you have to get rid of the bootloader which means you have to replace it. If you install your sketch in it's place you'll have exactly what you want.


Hi Pylon,

Thanks for your advice!  I used an AVRISP mkII to program the board.  (Or, at least, I think I did; the programmer has "AVRATAVRISPMKII" written on the back and looks like this: http://www.atmel.com/Images/AVRISPmkII.jpg).  When I plug the Arduino in now, it starts up much, much faster; almost instantaneously rather than the 8-10 second wait that I saw before.  Unfortunately I get the same messages on Windows machines about installing Arduino drivers.

Maybe what I did is not exactly what you recommended.  To program the Arduino with the AVRISP, I used the 1.0.1 IDE, selected AVRISP from the menus, and held shift down when clicking the upload button so that it says "Upload with programmer" or something like that.

Does that sound about right?  Do you have any other ideas about what this might be?



The USB stuff in the Leonardo identifies itself as both a serial and a HID device. So even if you install without the bootloader and you are not using Serial.anything in your sketch, the IDE is still loading the CDC serial stuff into the compiled sketch behind the scenes.

Hopefully in a future version of the IDE it will be more dynamic as it really shouldn't load the CDC stuff if you aren't using it, nor should it load the HID stuff if you never use the mouse.stuff or keyboard.stuff.

In the meantime there are some things you can do to make it not include the CDC stuff, but that involves making some tweaks directly to the Arduino core files. If you find the USBDesc.h file, line 19 is #define CDC_ENABLED, just comment that line out so it is //#define CDC_ENABLED then recompile and load your sketch. Do this without the bootloader again, with your ISP device.

After that, the Leonardo should identify itself as a HUD only and not ask for drivers.

Caveat: With the CDC disabled, it will not Auto-reset any more for loading sketches BUT this does not matter if you haven't got a bootloader anyways.



Go Up