EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #170 background imageLoading...
Page #170 background image
No big surprises here: we define a global
Nunchuk
object and initialize it in the
setup
function. In
loop
, we call
update
to request the controllers current status
and output all attributes to the serial port.
Compile and upload the program, and then open the serial monitor and play
around with the Nunchuk. Move the stick, move the controller, and press the
buttons, and you should see something like this:
46 109 428 394 651 1 1
49 132 414 380 656 1 0
46 161 415 390 651 1 0
46 184 429 377 648 1 0
53 199 404 337 654 1 0
53 201 406 359 643 1 0
You have successfully connected a Nunchuk controller to your Arduino. It
really isnt rocket science, and in the next section youll learn how to use it
to control your own video games.
The next time you buy a new piece of hardware, try to imagine how to use it
in a different context. Often its easier than you think. Oh, and whenever you
create a class such as our
Nunchuk
class, consider turning your code into a
library and making it available on the Internet. (See Chapter 4, Building a
Morse Code Generator Library, on page 61, to learn how to create your own
libraries.)
Creating Your Own Video Game Console
Now that you know how to generate video output and how to control the Wii
Nunchuk, it seems natural to build your own little video game console. You
only have to combine the Nunchuk circuit and the circuit for generating the
video signal. See Figure 27, Circuit of our video game console, on page 154.
Note that you still dont need a breadboard. Simply connect the Nunchuk to
the Arduino as shown on page 146 and connect the RCA cable as shown on
page 133. Thats all you have to do to create your own video game console.
Now lets write some games for it.
Creating Your Own Video Game
TVout and our Nunchuk library are all we need to write entertaining games
for our video game console. In this section well build Pragduino, a simple
game that demonstrates most of the skills you need to write more complex
games.
report erratum discuss
Creating Your Own Video Game Console 153
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals