MintDuino - Building an Arduino Compatible Breadboard Microcontroller V413HAV.pdf

(39830 KB) Pobierz
CREATE YOUR
OWN 2-PLAYER
LED GAME
Project Book
MintDuino
Building an Arduino-Compatible
Breadboard Microcontroller
James Floyd Kelly
& Marc de Vinck
1143102349.050.png 1143102349.061.png 1143102349.071.png 1143102349.074.png 1143102349.001.png 1143102349.002.png 1143102349.003.png 1143102349.004.png 1143102349.005.png 1143102349.006.png 1143102349.007.png 1143102349.008.png 1143102349.009.png 1143102349.010.png 1143102349.011.png 1143102349.012.png 1143102349.013.png 1143102349.014.png 1143102349.015.png 1143102349.016.png 1143102349.017.png 1143102349.018.png 1143102349.019.png 1143102349.020.png 1143102349.021.png 1143102349.022.png 1143102349.023.png 1143102349.024.png 1143102349.025.png 1143102349.026.png 1143102349.027.png 1143102349.028.png 1143102349.029.png 1143102349.030.png 1143102349.031.png 1143102349.032.png 1143102349.033.png 1143102349.034.png 1143102349.035.png 1143102349.036.png
 
Project Book
MintDuino
Building an Arduino-Compatible Breadboard
Microcontroller
Get started with MintDuino, the Maker Shed kit that’s perfect for
learning or teaching the fundamentals of how microcontrollers
work. This hands-on book shows you how to build a complete
MintDuino project from start to inish. Learn how to assemble the
microcontroller on a breadboard (no soldering required), and
immediately begin programming it.
You’ll build the MintDuino Relex Game in ive separate stages or
sub-tasks. Breaking down a large project into manageable tasks
helps you track down errors quickly, and lets you see how each part
of the circuit works. Once you complete the game, you’ll have the
resources and experience to tackle more MintDuino projects. If
you’re interested in the fascinating world of microcontrollers, you’ll
enjoy this book.
n WireupandprogramtheMintDuinotolightanLED
n Buildagamethatteststherelexesoftwoplayers
n Learnhowtomakeyour“gamelight”glowatrandom
intervals
n Constructapushbuttoncircuittocontrolindividualplayers’
LEDs
n Put all of the components together, including simple code
tocontrolyourgame
US $4.99
CAN $5.99
ISBN: 978-1-449-30766-0
Twitter: @oreillymedia
facebook.com/oreilly
oreilly.com
1143102349.037.png 1143102349.038.png 1143102349.039.png 1143102349.040.png 1143102349.041.png 1143102349.042.png 1143102349.043.png 1143102349.044.png 1143102349.045.png 1143102349.046.png 1143102349.047.png 1143102349.048.png 1143102349.049.png 1143102349.051.png 1143102349.052.png 1143102349.053.png 1143102349.054.png 1143102349.055.png 1143102349.056.png 1143102349.057.png 1143102349.058.png 1143102349.059.png 1143102349.060.png 1143102349.062.png 1143102349.063.png
 
MintDuino
James Floyd Kelly and
Marc de Vinck
Beijing
Cambridge
Farnham
Köln
Sebastopol
Tokyo
1143102349.064.png 1143102349.065.png 1143102349.066.png 1143102349.067.png 1143102349.068.png 1143102349.069.png 1143102349.070.png 1143102349.072.png 1143102349.073.png
MintDuino
by James Floyd Kelly and Marc de Vinck
Copyright © 2011 Blue Rocket Writing Services, Inc. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online
editions are also available for most titles ( http://my.safaribooksonline.com ) . For more informa-
tion, contact our corporate/institutional sales department: (800) 998-9938 or
Editor: Brian Jepson
Production Editor: Kristen Borg
Proofreader: O’Reilly Production Services
Cover Designer:
Mark Paglietti
Interior Designer:
David Futato
Illustrator:
Robert Romano
September 2011:
First Edition.
Revision History for the First Edition:
September 12, 2011 First release
December 16, 2011 Second release
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. The Maker Press series desig-
nations, MintDuino , and related trade dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc.,
was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors
assume no responsibility for errors or omissions, or for damages resulting from the use of the
information contained herein.
ISBN: 978-1-449-30766-0
[LSI]
1325889248
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
1/Build a Mintronics: MintDuino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Build the Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Power the Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Getting Ready to Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2/The MintDuino Reflex Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3/Subtask 1: Light an LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Start Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Upload Your First Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4/Subtask 2: Randomly Light an LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
The Game Takes Shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5/Subtask 3: Light an LED with a Pushbutton . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Light the LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6/Subtask 4: Add Buttons and LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Light LEDs for Each Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7/Subtask 5: Program the Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
The Final Sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Contents
iii
Zgłoś jeśli naruszono regulamin