Go Down

Topic: USB Mouse library working for anyone? (Read 2856 times) previous topic - next topic

floydx

I'm quite desperate to get the USBMouse library to work again for me, for a big school project. I'm making an alternative cursor control device that depends on the arduino acting as a USB HID.

2 days ago I got the library to work, but then overnight it stopped working. I have no idea why.

I'm using an Arduino Duemilanove and Arduino 15 and 16.

Code I'm trying to compile:
Quote

#include <UsbMouse.h>

#define BUTTON_PIN 12

void setup() {
 pinMode(BUTTON_PIN, INPUT);
 digitalWrite(BUTTON_PIN, HIGH);
}

void loop() {
 UsbMouse.refresh(); // Do some house keeping

 if(digitalRead(BUTTON_PIN) == LOW){
   UsbMouse.move(5,5);
 }
 UsbMouse.move(0,0);
}


But these are the errors I am getting:
Quote
hardware\libraries\UsbMouse/UsbMouse.h: In constructor 'UsbMouseDevice::UsbMouseDevice()':

hardware\libraries\UsbMouse/UsbMouse.h:32: error: 'sei' was not declared in this scope


Any assistance would be greatly appreciated!

Grumpy_Mike

#1
Aug 06, 2009, 05:27 pm Last Edit: Aug 06, 2009, 05:28 pm by Grumpy_Mike Reason: 1
I haven't seen this library, it's not one on the library page. But what that error message is telling you is that when the software went into the file UsbMouse.h it found a variable called sei that hadn't been declared.

Now the question is why and what can you do about it? It could just be it is a bad library but more likely is that this variable was declared in another include file that you haven't included in your code.

So look at any examples you have that use this library and see if they include other files before it calls the UsbMouse.h file, and if you find one include that as well. You might even have to add another dependant library.


mem

perhaps try contacting the author of that library:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?action=viewprofile;username=follower

Mark Anderson

I think it might be important to point out that this sort of problem can NOT "just happen"!

My students often bring me questions like this. As part of the engineering process I have to reply with - "well, what did you change"?

and so - what did you change? lines of code do not go "missing" or get altered by themselves! It CAN happen if you download a new version of part of your software. Thus even though you did not change "your code", you actually changed part of the code you reference through the include files...

I hope that gives you a starting point! Good luck.
Mark

noonv

im get the same problem :)
if you'll insert into UsbMouse.h
Code: [Select]
#include <avr/interrupt.h>
you will solve it, but get another  :-/
Quote


\Temp\build34831.tmp\UsbMouse\usbdrv.c.o: In function `usbBuildTxBlock':

\Arduino\libraries\UsbMouse/usbdrv.c:484: undefined reference to `usbCrc16Append'

Temp\build34831.tmp\UsbMouse\usbdrv.c.o: In function `usbSetInterrupt':

Arduino\libraries\UsbMouse/usbdrv.c:249: undefined reference to `usbCrc16Append'

::)

follower

The OP error looks like a change of Arduino IDE version.

The second error looks compilation related.

Note that version 0017 does not work with this library due to the new library compilation method.

When version 0018 is released it should work again due to the inclusion of assembler support.

--Philip;

camilaluiza

Hi people,

Following the instructions of noonv I solved this problem of compilation:

"hardware\libraries\UsbMouse/UsbMouse.h: In constructor 'UsbMouseDevice::UsbMouseDevice()':
hardware\libraries\UsbMouse/UsbMouse.h:32: error: 'sei' was not declared in this scope"

But then appeard this another:

o: In function `usbSetInterrupt':
C:\Users\Rita\AppData\Local\Temp\build5353425294472682581.tmp/usbdrv.c:249: undefined reference to `usbCrc16Append'

How can I solved this error?
I'm already using version 0018.

Is there another alternative to create a USB mouse?
Camila

natman3400

Well, this thread is no longer valid (I think) due to us advancing 2-3 software versions

onsmdshelp


Go Up