From 57b3395691c0d522fe008294b81c6188a70bd9a8 Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Wed, 28 Mar 2012 14:40:44 -0400 Subject: [PATCH] Moved begin() in JoystickMouseControl example. --- .../Mouse/JoystickMouseControl/JoystickMouseControl.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/shared/examples/09. USB (Leonardo only)/Mouse/JoystickMouseControl/JoystickMouseControl.ino b/build/shared/examples/09. USB (Leonardo only)/Mouse/JoystickMouseControl/JoystickMouseControl.ino index 64650d5dd..5f69c707b 100644 --- a/build/shared/examples/09. USB (Leonardo only)/Mouse/JoystickMouseControl/JoystickMouseControl.ino +++ b/build/shared/examples/09. USB (Leonardo only)/Mouse/JoystickMouseControl/JoystickMouseControl.ino @@ -21,7 +21,7 @@ you can turn on and off mouse control. created 15 Sept 2011 - updated 27 Mar 2012 + updated 28 Mar 2012 by Tom Igoe this code is in the public domain @@ -47,6 +47,8 @@ int lastSwitchState = LOW; // previous switch state void setup() { pinMode(switchPin, INPUT); // the switch pin pinMode(ledPin, OUTPUT); // the LED pin + // take control of the mouse: + Mouse.begin(); } void loop() { @@ -67,8 +69,6 @@ void loop() { int xReading = readAxis(A0); int yReading = readAxis(A1); - // take control of the mouse: - Mouse.begin(); // if the mouse control state is active, move the mouse: if (mouseIsActive) { Mouse.move(xReading, yReading, 0);