Hardware Reference
In-Depth Information
To detect mouse clicks, the readButton() function was created so that it can
be repeated for each of the three buttons to detect. The function detects the cur-
rent state of the mouse with the Mouse.isPressed() command and controls the
mouse accordingly using the Mouse.press() and Mouse.release() functions.
NOTE Towatchademovideoofthejoystickmousecontrollingacomputer
pointer,checkout www.exploringarduino.com/content/ch6 .Youcanalso
findthisvideoontheWileywebsiteshownatthebeginningofthischapter.
Summary
In this chapter you learned about the following:
Arduinos connect to your computer via a USB-to-serial converter.
Different Arduinos facilitate a USB-to-serial conversion using either dedi-
cated ICs or built-in USB functionality.
Your Arduino can print data to your computer via your USB serial
connection.
You can use special serial characters to format your serial printing with
newlines and tabs.
All serial data is transmitted as character that can be converted to integers
in a variety of ways.
You can send comma-separated integer lists and use integrated functions
to parse them into commands for your sketch.
You can send data from your Arduino to a Processing desktop application.
You can receive data from a Processing application on your desktop to
control peripherals connected to your Arduino.
An Arduino Leonardo can be used to emulate a keyboard or mouse.
 
Search WWH ::




Custom Search