Pages: [1]   Go Down
Author Topic: Using Leonardo as mouse. How to prevent automatic driver install on Windows?  (Read 518 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

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?

Thanks.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4682
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Thanks.
Logged

Canada
Offline Offline
Jr. Member
**
Karma: 1
Posts: 81
Frequently Befuddled
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Cheers!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That seems to have done the trick.  Thank you!
Logged

Pages: [1]   Go Up
Jump to: