Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9f1082e

Browse files
Merge pull request #228 from arduino/jhansson-ard/legacy-cnt-updates
Updated instructions to tutorial
2 parents f953040 + 3326e00 commit 9f1082e

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

‎content/built-in-examples/09.usb/JoystickMouseControl/JoystickMouseControl.md‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,25 @@ tags:
99
- Joystick
1010
---
1111

12-
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.
12+
Using the Mouse library, you can control 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.
1313

14-
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.
14+
Cursor movement from the Arduino is always relative. So every time the analog input is read, the cursor's position is updated relative to its current position.
1515

16-
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.
16+
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.
1717

1818
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.
1919

20-
**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.**
20+
***Note: If you want to add the LED or the extra pushbutton, please follow the guidelines for the [LED circuit](../basics/Blink) and the [button circuit](../digital/Button).***
21+
22+
***Note: 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.***
2123

2224
### Hardware Required
2325

2426
- Arduino Leonardo, Micro, or Due board
25-
2627
- 2 axis joystick
27-
2828
- momentary pushbutton (possibly integrated in the joystick)
29-
3029
- LED
31-
3230
- 220 ohm resistor
33-
3431
- 10k ohm resistor (if needed as pulldown)
3532

3633
### Circuit
@@ -39,13 +36,10 @@ Connect your Leonardo board to your computer with a micro-USB cable. The pushbut
3936

4037
![](assets/circuit.png)
4138

42-
43-
4439
### Schematic
4540

4641
![](assets/schematic.png)
4742

48-
4943
### Code
5044

5145
<iframe src='https://create.arduino.cc/example/builtin/09.USB%5CMouse%5CJoystickMouseControl/JoystickMouseControl/preview?embed&snippet' style='height:510px;width:100%;margin:10px 0' frameborder='0'></iframe>
@@ -55,5 +49,3 @@ Connect your Leonardo board to your computer with a micro-USB cable. The pushbut
5549
You can find more basic tutorials in the [built-in examples](/built-in-examples) section.
5650

5751
You can also explore the [language reference](https://www.arduino.cc/reference/en/), a detailed collection of the Arduino programming language.
58-
59-
*Last revision 2015年07月29日 by SM*

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /