Author Topic: DigiMouse cant compile  (Read 4448 times)

flax2000

  • Newbie
  • *
  • Posts: 5
DigiMouse cant compile
« on: December 19, 2014, 11:12:05 pm »
Hello all the other USB libraries seems to be working now, but the library i really need the mouse one still wont compile. but the error are a new one at least:


Mouse.ino: In function 'void setup()':
Mouse.ino:8:13: error: 'class DigiMouseDevice' has no member named 'begin'
Mouse.ino: In function 'void loop()':
Mouse.ino:34:13: error: 'class DigiMouseDevice' has no member named 'rightClick'
Mouse.ino:35:13: error: 'class DigiMouseDevice' has no member named 'leftClick'
Mouse.ino:36:13: error: 'class DigiMouseDevice' has no member named 'middleClick'
Fel vid kompilering.

Any ideas?

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiMouse cant compile
« Reply #1 on: December 20, 2014, 01:44:07 am »
DigiMouse gives me the same.  The old library I have from 6/30/14 has begin() function - also the XXXclick()'s - but they are not in the current drop. 

Doing a DIFF I found this to work:
void setup() {
  DigiMouseDevice();
|

The other code compiles and works except these functions are no longer supported, so remove them:
  DigiMouse.rightClick();
  DigiMouse.leftClick();
  DigiMouse.middleClick();

Also these #defines are gone to ID buttons - but the values #1 and #2 are correct for DigiMouse.setButtons():
#define MOUSEBTN_LEFT_MASK      0x01
#define MOUSEBTN_RIGHT_MASK   0x02
#define MOUSEBTN_MIDDLE_MASK   0x04

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiMouse cant compile
« Reply #2 on: December 20, 2014, 03:01:08 pm »
Pending updates to DigiMouse look to be in new release v1.5.8B.  I see functions noted above are to be restored.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiMouse cant compile
« Reply #4 on: December 21, 2014, 05:30:22 am »
It Compiles and Works - very annoyingly!

flax2000

  • Newbie
  • *
  • Posts: 5
Re: DigiMouse cant compile
« Reply #5 on: December 21, 2014, 08:24:41 pm »
Yea compiles alright now, but only starts the mouse 1 of 4 times. will get a new hub and try another cable and see.
anyway big thank you for the fast support on this.

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiMouse cant compile
« Reply #6 on: December 22, 2014, 04:03:26 am »
It seemed to work for me on Win8.1 machine, but not now on Win7 ?

Not sure why this offered code is commented out: while(!DigiMouse.isConnected()) {} //don't run sketch until USB is connected

I decided to make the LED blink to show signs of life and so I could extend the program and get feedback. Like Don't do any active stuff until I click the middle button.

So I made a blink_DM_delay() as a wrapper around DigiMouse.delay();.  Code noted below seems to work reliably to give signs of life, why it works now with no change I cannot say - other than I commented out the last five calls to DigiMouse.???() in the sample sketch.

There is a Digistump bootloader driver installed that seems to promote uploading without powering the device when using this.  I was seeing error -1 and moved to new USB port then stopped unplugging/resetting and it recognized the driver and worked to upload?  Not sure if this is related?

Code: [Select]
void setup() {
  pinMode(1, OUTPUT); //LED on Model A  or Pro
  DigiMouse.begin(); //start or reenumerate USB - BREAKING CHANGE from old versions that didn't require this
}

bool blinkState = 0;

void blink_DM_delay( int wait ) {
  if (blinkState) {
    blinkState = 0;
    digitalWrite(1, LOW);
  }
  else {
    blinkState = 1;
    digitalWrite(1, HIGH);
  }
  DigiMouse.delay(wait);
}

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: DigiMouse cant compile
« Reply #7 on: January 03, 2015, 02:55:44 pm »
DigiMouse works for me just fine on win7 and 8.1 - but the next release will have some updates to hopefully solve most issues others are seeing.