I am using the new Arduino Due to try and move a mouse on my Macbook pro. On the Arduino website it says that I should be able to just add numbers into Mouse.move(xVal, yVal, wheel). I have tried adding numbers in the xVal and yVal positions ranging from .5 to 1000000, but the mouse never moves. I also am trying to use the code that they have on their website as demo code which takes in voltages from analog ports and puts them into the xVal and yVal. I have set it up with two 1K resistors in series with the analog inputs going into A0 and A1 with a voltage supply of 2.1 V. The amount the mouse moves should depend on how much voltage is entering the Arduino, but I am only getting -6 to 6 V coming into the Arduino. Does anyone have any suggestions about how to make the mouse move with Arduino’s demo program or just in general? Thank you so much for the help.
Link to Arduino demo code:
http://arduino.cc/en/Reference/MouseMov … lock&num=1
My code:
void setup()
{
Serial.begin(4800);
Mouse.begin();
}
void loop()
{
if (analogRead(0) > 500)
{
Serial.println(“Hello”);
Mouse.move(100,100,0);
}
else
{
Serial.println(“Goodbye”);
Mouse.move(-100,-100,0);
}
}