Tutorial.JoystickMouseControl History

Show minor edits - Show changes to markup

August 28, 2015, at 04:26 PM by Simone Maiocchi -
Changed lines 1-6 from:
to:
Added lines 27-28:

Hardware Required

Deleted line 29:

Hardware Required

Changed lines 49-51 from:
to:
Changed lines 68-74 from:
to:
July 29, 2015, at 03:26 PM by Simone Maiocchi -
Changed lines 60-62 from:
to:
July 08, 2015, at 07:15 PM by Simone Maiocchi -
Changed lines 14-15 from:

The pushbutton allows you to toggle mouse control on and off. As an option you may connect a status LED to pin 5 that lights upwhen the Arduino is controlling the mouse.

to:

The pushbutton allows you to toggle mouse control on and off. As an option you may connect a status LED to pin 5 that lights upwhen the Arduino is controlling the mouse. A second pushbutton may be connected with another 10k ohm pulldown (to GND) resistor to D3 to act as the left click of the mouse.

Changed line 25 from:
  • 10k ohm resistor (if needed as pullup)
to:
  • 10k ohm resistor (if needed as pulldown)
July 08, 2015, at 06:40 PM by Simone Maiocchi -
Changed line 47 from:

Code

to:

Code

July 08, 2015, at 06:39 PM by Simone Maiocchi -
Added line 34:
July 08, 2015, at 06:38 PM by Simone Maiocchi -
Added lines 32-33:

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Changed lines 39-41 from:

image developed using Fritzing. For more circuit examples, see the Fritzing project page

to:
Changed lines 42-43 from:
to:

click the images to enlarge

July 08, 2015, at 06:36 PM by Simone Maiocchi -
Changed lines 5-6 from:
to:
Added lines 34-36:
Changed line 51 from:

See Also

to:

See Also

July 08, 2015, at 06:33 PM by Simone Maiocchi -
Changed lines 1-3 from:

Examples > Joystick

Joystick Mouse Control

to:
Changed lines 14-15 from:

The pushbutton allows you to toggle mouse control on and off. A status LED connected to pin 5 lights when the Arduino is controlling the mouse.

to:

The pushbutton allows you to toggle mouse control on and off. As an option you may connect a status LED to pin 5 that lights upwhen the Arduino is controlling the mouse.

Changed line 19 from:

Hardware Required

to:

Hardware Required

Changed lines 22-27 from:
  • momentary pushbutton
  • One 10-kilohm resistor (if needed)

Software Required

  • none
to:
  • momentary pushbutton (possibly integrated in the joystick)
  • LED
  • 220 ohm resistor
  • 10k ohm resistor (if needed as pullup)
Changed line 28 from:

Circuit

to:

Circuit

October 31, 2012, at 09:58 PM by Scott Fitzgerald -
Changed lines 4-7 from:

Using the Mouse library, you can controls a computer's onscreen cursor with an Arduino Leonardo. This particular example uses a pushbutton to turn on and off mouse control with a joystick.

Cursor movement from the Leonardo is always relative. So every time the analog input is read, the cursor's position is updated relative to it's current position.

to:

Using the Mouse library, you can controls a computer's onscreen cursor with an Arduino Leonardo, Micro, or Due. This particular example uses a pushbutton to turn on and off mouse control with a joystick.

Cursor movement from the Arduino is always relative. So every time the analog input is read, the cursor's position is updated relative to it's current position.

Changed lines 10-11 from:

The pushbutton allows you to toggle mouse control on and off. A status LED connected to pin 5 lights when the Leonardo is controlling the mouse.

to:

The pushbutton allows you to toggle mouse control on and off. A status LED connected to pin 5 lights when the Arduino is controlling the mouse.

Changed line 16 from:
  • Arduino Leonardo board
to:
  • Arduino Leonardo, Micro, or Due board
Deleted line 39:
Changed lines 41-46 from:
to:
Deleted lines 43-161:
Changed line 52 from:
to:
May 21, 2012, at 07:42 PM by Scott Fitzgerald -
Changed lines 42-167 from:
to:
May 02, 2012, at 04:15 PM by Scott Fitzgerald -
Changed line 42 from:
to:
April 27, 2012, at 06:32 PM by Scott Fitzgerald -
Changed line 51 from:
to:
April 27, 2012, at 06:30 PM by Scott Fitzgerald -
Changed line 32 from:
to:
Changed line 42 from:
to:
Changed line 51 from:

\\

to:
March 28, 2012, at 08:24 PM by Scott Fitzgerald -
Changed lines 4-5 from:

With the Mouse library, you can controls a computer's onscreen cursor with an Arduino Leonardo. This particular example uses a pushbutton to turn on and off mouse control with a joystick.

to:

Using the Mouse library, you can controls a computer's onscreen cursor with an Arduino Leonardo. This particular example uses a pushbutton to turn on and off mouse control with a joystick.

Changed lines 8-9 from:

Two analog inputs ranging from 0 to 1023 are translated to ranges of -60 to 60. The sketch assumes that the joystick resting values are around the middle of the range, but that they vary within a threshold.

to:

Two analog inputs ranging from 0 to 1023 are translated to ranges of -12 to 12. The sketch assumes that the joystick resting values are around the middle of the range, but that they vary within a threshold.

The pushbutton allows you to toggle mouse control on and off. A status LED connected to pin 5 lights when the Leonardo is controlling the mouse.

December 07, 2011, at 01:43 AM by Scott Fitzgerald -
Changed lines 43-48 from:
to:
November 28, 2011, at 09:06 PM by Scott Fitzgerald -
Changed line 40 from:
to:
November 22, 2011, at 03:25 AM by Scott Fitzgerald -
Changed lines 10-11 from:

NB: When you use the Mouse.move() command, the Arduino takes over your computer's cursor! To insure you don't lose control of your computer while running a sketch with this function, make sure to set up a controller before you call Mouse.move(). This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.

to:

NB: When you use the Mouse.move() command, the Arduino takes over your computer's cursor! To insure you don't lose control of your computer while running a sketch with this function, make sure to set up a controller before you call Mouse.move(). This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.

November 22, 2011, at 03:25 AM by Scott Fitzgerald -
Changed lines 10-11 from:

WARNING: When you use the Mouse.move() command, the Arduino takes over your mouse! Make sure you have control before you use the command. This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.

to:

NB: When you use the Mouse.move() command, the Arduino takes over your computer's cursor! To insure you don't lose control of your computer while running a sketch with this function, make sure to set up a controller before you call Mouse.move(). This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.

November 22, 2011, at 03:06 AM by Scott Fitzgerald -
Changed lines 4-9 from:

Controls the mouse from a joystick on an Arduino Leonardo. Uses a pushbutton to turn on and off mouse control.

The mouse movement is always relative. This sketch reads two analog inputs that range from 0 to 1023 (or less on either end) and translates them into ranges of -60 to 60. The sketch assumes that the joystick resting values are around the middle of the range, but that they vary within a threshold.

WARNING: When you use the Mouse.move() command, the Arduino takes over your mouse! Make sure you have control before you use the command. This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.

to:

With the Mouse library, you can controls a computer's onscreen cursor with an Arduino Leonardo. This particular example uses a pushbutton to turn on and off mouse control with a joystick.

Cursor movement from the Leonardo is always relative. So every time the analog input is read, the cursor's position is updated relative to it's current position.

Two analog inputs ranging from 0 to 1023 are translated to ranges of -60 to 60. The sketch assumes that the joystick resting values are around the middle of the range, but that they vary within a threshold.

WARNING: When you use the Mouse.move() command, the Arduino takes over your mouse! Make sure you have control before you use the command. This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.

November 22, 2011, at 12:42 AM by Scott Fitzgerald -
Changed lines 31-32 from:
to:
November 22, 2011, at 12:41 AM by Scott Fitzgerald -
Changed lines 23-25 from:

Connect your Leonardo board to your computer with a micro-USB cable. The pushbutton is connected to pin 6. If you're using a part like the Joystick shield pictured below, you may not need a pulldown resistor. The x-axis on the joystick is connected to analog in 0, the y-axis iss on analog in 1.

to:
November 19, 2011, at 07:55 PM by Scott Fitzgerald -
Changed lines 15-16 from:
  • One 10-kilohm resistor
to:
  • One 10-kilohm resistor (if needed)
Changed lines 23-25 from:

Connect your Leonardo board to your computer with a micro-USB cable.

to:

Connect your Leonardo board to your computer with a micro-USB cable. The pushbutton is connected to pin 6. If you're using a part like the Joystick shield pictured below, you may not need a pulldown resistor. The x-axis on the joystick is connected to analog in 0, the y-axis iss on analog in 1.

November 19, 2011, at 07:15 PM by Scott Fitzgerald -
Changed lines 4-9 from:
 Controls the mouse from a joystick on an Arduino Leonardo.  Uses a pushbutton to turn on and off mouse control.

 The mouse movement is always relative. This sketch reads  two analog inputs that range from 0 to 1023 (or less on either end) and translates them into ranges of -60 to 60.  The sketch assumes that the joystick resting values are around the middle of the range, but that they vary within a threshold.

 WARNING:  When you use the Mouse.move() command, the Arduino takes over your mouse!  Make sure you have control before you use the command. This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.
to:

Controls the mouse from a joystick on an Arduino Leonardo. Uses a pushbutton to turn on and off mouse control.

The mouse movement is always relative. This sketch reads two analog inputs that range from 0 to 1023 (or less on either end) and translates them into ranges of -60 to 60. The sketch assumes that the joystick resting values are around the middle of the range, but that they vary within a threshold.

WARNING: When you use the Mouse.move() command, the Arduino takes over your mouse! Make sure you have control before you use the command. This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.

November 19, 2011, at 07:14 PM by Scott Fitzgerald -
November 19, 2011, at 07:14 PM by Scott Fitzgerald -
Changed lines 4-5 from:

This example listens for a byte coming from the serial port. When received, the Leonardo send a keystroke back to the computer. The sent keystroke is one higher than what is received, so if you send an "a" from the serial monitor, you'll receive a "b" from the Leonardo. A "1" will return a "2" and so on.

to:
 Controls the mouse from a joystick on an Arduino Leonardo.  Uses a pushbutton to turn on and off mouse control.

 The mouse movement is always relative. This sketch reads  two analog inputs that range from 0 to 1023 (or less on either end) and translates them into ranges of -60 to 60.  The sketch assumes that the joystick resting values are around the middle of the range, but that they vary within a threshold.

 WARNING:  When you use the Mouse.move() command, the Arduino takes over your mouse!  Make sure you have control before you use the command. This sketch includes a pushbutton to toggle the mouse control state, so you can turn on and off mouse control.
Changed lines 13-16 from:
to:
  • 2 axis joystick
  • momentary pushbutton
  • One 10-kilohm resistor
November 19, 2011, at 06:43 PM by Scott Fitzgerald -
Changed line 22 from:
to:
November 19, 2011, at 06:43 PM by Scott Fitzgerald -
Changed line 22 from:
to:
November 19, 2011, at 06:42 PM by Scott Fitzgerald -
Added lines 1-26:

Share