Pages: [1]   Go Down
Author Topic: USB Mouse library working for anyone?  (Read 2670 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 637
Posts: 34599
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: August 06, 2009, 10:28:10 am by Grumpy_Mike » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is this library:

http://code.rancidbacon.com/ProjectLogArduinoUSB

http://www.arduino.nl/?p=34
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

perhaps try contacting the author of that library:

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

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

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
Logged

Kaliningrad, Russia
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

im get the same problem smiley
if you'll insert into UsbMouse.h
Code:
#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'
:smiley
Logged


New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 95
NAM Modular Systems industries
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

same problem for me....
Logged

Pages: [1]   Go Up
Jump to: