I am working on a project with the Mousecontrol library. This causes me a lot of problems with loading the library. I imported the library but it gives me errors everytime. I think it is a mistake in the library folders but I can't seem to figure it out.
#include <MouseController.h>
// Initialize USB Controller
USBHost usb;
// Attach mouse controller to USB
MouseController mouse(usb);
void setup(){
Serial.begin(9600);
}
void loop(){
usb.Task();
}
void mouseMoved() {
Serial.print("Move: ");
Serial.print(mouse.getXChange());
Serial.print(", ");
Serial.println(mouse.getYChange());
}
I get this error:
Arduino: 1.6.0 (Mac OS X), Board:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
In file included from /Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/MouseController.h:22:0,
from Muis_Bevrijding.ino:1:
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h: In member function 'virtual void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint32_t, uint32_t, uint32_t, uint32_t, const USB_ENDPOINT_DESCRIPTOR*)':
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h:474:62: error: 'UOTGHS_HSTPIPCFG_PTYPE_INTRPT' was not declared in this scope
pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
^
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h:474:93: error: 'UOTGHS_HSTPIPCFG_PTOKEN_IN' was not declared in this scope
pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
^
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h:474:151: error: 'UOTGHS_HSTPIPCFG_PBK_1_BANK' was not declared in this scope
pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
^
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h:474:178: error: there are no arguments to 'UHD_Pipe_Alloc' that depend on a template parameter, so a declaration of 'UHD_Pipe_Alloc' must be available [-fpermissive]
pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
^
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h:474:178: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h: In member function 'virtual uint32_t HIDBoot<BOOT_PROTOCOL>::Release()':
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h:500:54: error: there are no arguments to 'UHD_Pipe_Free' that depend on a template parameter, so a declaration of 'UHD_Pipe_Free' must be available [-fpermissive]
UHD_Pipe_Free(epInfo[epInterruptInIndex].hostPipeNum);
^
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h: In instantiation of 'uint32_t HIDBoot<BOOT_PROTOCOL>::Release() [with unsigned char BOOT_PROTOCOL = 2u; uint32_t = long unsigned int]':
Muis_Bevrijding.ino:22:1: required from here
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h:500:54: error: 'UHD_Pipe_Free' was not declared in this scope
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h: In instantiation of 'void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint32_t, uint32_t, uint32_t, uint32_t, const USB_ENDPOINT_DESCRIPTOR*) [with unsigned char BOOT_PROTOCOL = 2u; uint32_t = long unsigned int]':
Muis_Bevrijding.ino:22:1: required from here
/Users/jamiederooij/Downloads/Arduino.app/Contents/Resources/Java/libraries/USBHost/src/hidboot.h:474:178: error: 'UHD_Pipe_Alloc' was not declared in this scope
pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
^
Thanks a lot for your time!