Hardware Reference
In-Depth Information
Just like with the keyboard functionality, the Arduino language has some great
functions built in that make it easy to control mouse functionality.
First things first, get your circuit set up with a joystick and some buttons as
shown in FigureĀ 6-17. Don't forget that your buttons need to have pull-down
resistors! The joystick will connect to analog pins 0 and 1. (Joysticks are actually
just two potentiometers hooked up to a knob.) When you move the joystick all
the way in the x direction, it maxes out the x potentiometer, and the same goes
for the y direction.
Joystick
Left
mouse
button
Middle
mouse
button
Right
mouse
button
Figure 6-17: Joystick Leonardo mouse circuit
Search WWH ::




Custom Search