weird_dave:
There's no real documentation, but a quick look at the code suggests it emulates a mouse using 9 input pins. I don't think it does autofire (I didn't dive too deep into the code). I don't even know for sure this will work on the Due, it will certainly require changes, the pin definitions are weird for a start
It was designed to run on this:
http://chipkit.net/wpcproduct/pontech-quick240/
Okay thanks.
I made this code which I thought would work if I had a on the Go adaptor or a USB HOST SHIELD with my Due. In my logic it works, well I am at least pretty sure that at least the mouse button press and release works but idk about the move. If it doesn't work could you explain why because I don't understand what this class does otherwise.
// Require mouse control library
#include <MouseController.h>
// Initialize USB Controller
USBHost usb;
// Attach mouse controller to USB
MouseController mouse(usb);
// variables for mouse button states
boolean leftButton = false;
boolean middleButton = false;
boolean rightButton = false;
int MouseX;
int MouseY;
int MouseXD;
int MouseYD;
// This function intercepts mouse movements
void mouseMoved() {
MouseX = mouse.getXChange();
MouseY = mouse.getYChange();
Mouse.move(MouseX, MouseY, wheel);
}
// This function intercepts mouse movements while a button is pressed
void mouseDragged() {
MouseXD = mouse.getXChange();
MouseYD = mouse.getYChange();
Mouse.move(MouseXD, MouseYD, wheel);
}
// This function intercepts mouse button press
void mousePressed() {
while (mouse.getButton(LEFT_BUTTON)){
// autoclicker while loop
}
if (mouse.getButton(MIDDLE_BUTTON)){
Mouse.press(MOUSE_MIDDLE)
middleButton = true;
}
if (mouse.getButton(RIGHT_BUTTON)){
Mouse.press(MOUSE_RIGHT)
rightButton = true;
}
}
// This function intercepts mouse button release
void mouseReleased() {
if (!mouse.getButton(LEFT_BUTTON) && left==true) {
Mouse.release(LEFT_BUTTON);
leftButton = false;
}
if (!mouse.getButton(MIDDLE_BUTTON) && middle==true) {
Mouse.release(MIDDLE_BUTTON);
middleButton = false;
}
if (!mouse.getButton(RIGHT_BUTTON) && right==true) {
Mouse.release(RIGHT_BUTTON);
rightButton = false;
}
}
void setup()
{
Serial.begin(9600);
Serial.println("Program started");
delay(200);
}
void loop()
{
// Process USB tasks
usb.Task();
}