Contents
Guide
Page List
About the Author
Simon Monk has a bachelors degree in cybernetics and computer science and a Ph.D. in software engineering. He has authored more than 20 books, including Programming Arduino: Getting Started with Sketches, Programming the Raspberry Pi, Programming the BBC micro:bit, and Practical Electronics for Inventors. Dr. Monk also runs the website monkmakes.com, which features his own products.
Copyright 2019 by McGraw-Hill Education. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher, with the exception that the program listings may be entered, stored, and executed in a computer system, but they may not be reproduced for publication.
ISBN: 978-1-25-958860-0
MHID: 1-25-958860-2
The material in this eBook also appears in the print version of this title: ISBN: 978-1-25-958859-4, MHID: 1-25-958859-9.
eBook conversion by codeMantra
Version 1.0
All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.
McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and sales promotions or for use in corporate training programs. To contact a representative, please visit the Contact Us page at www.mhprofessional.com.
McGraw-Hill Education, the McGraw-Hill Education logo, TAB, and related trade dress are trademarks or registered trademarks of McGraw-Hill Education and/or its affiliates in the United States and other countries and may not be used without written permission. All other trademarks are the property of their respective owners. McGraw-Hill Education is not associated with any product or vendor mentioned in this book.
Information has been obtained by McGraw-Hill Education from sources believed to be reliable. However, because of the possibility of human or mechanical error by our sources, McGraw-Hill Education, or others, McGraw-Hill Education does not guarantee the accuracy, adequacy, or completeness of any information and is not responsible for any errors or omissions or the results obtained from the use of such information.
TERMS OF USE
This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work. Use of this work is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit, distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Educations prior consent. You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your right to use the work may be terminated if you fail to comply with these terms.
THE WORK IS PROVIDED AS IS. McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill Education nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work or for any damages resulting therefrom. McGraw-Hill Education has no responsibility for the content of any information accessed through the work. Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect, incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause whatsoever whether such claim or cause arises in contract, tort or otherwise.
CONTENTS AT A GLANCE
CONTENTS
PREFACE
Since the first edition of this book was released in 2013, some things in the world of Arduino have stayed surprisingly constant and others have changed. The Arduino Uno is still most peoples idea of what an Arduino should be and the Arduino IDE has kept its simple interface, while adding some great new features such as the Library and Board Managers.
However, what has changed is that the word Arduino has come to denote a way of programming boards as much as the boards themselves. New Arduino-compatible boards provide a vast variety of hardware to choose from, all of which can be programmed using the Arduino IDE.
The main changes to this edition include the addition of two new chapters:
, When Is an Arduino Not an Arduino? This chapter shows you how to use the Arduino IDE with Arduino-compatible boards such as the ESP8266 and ESP32 boards as well as ARM m0 boards such as the Adafruit Circuit Playground Express and Trinket m0 boards.
, Interfacing with Arduino This chapter explains the theory behind interfacing with microcontrollers that you will need to understand when working with I2C, SPI, and UART serial.
The Network Programming chapter from the first edition (now , Network and Internet of Things Programming) has been extensively revised to include both official Arduino network programming and the more widely used ESP8266 and ESP32 WiFi programming. The chapter has also been extended to look at parsing JSON web services and use of the dweet.io IoT service.
, Managing with One Process, has gained a new section on designing programs using finite state machine diagrams.
The other chapters of the book have also been given a general update.
Simon Monk
ACKNOWLEDGMENTS
Many thanks to all those at McGraw-Hill Education who have done such a great job in producing this book. In particular, thanks to my editor Lara Zoble and to Patricia Wallenburg, Elizabeth Houde, Lynn Messina, Stephen Smith, and Claire Splan.
Thanks to Duncan Amos for his diligent technical review. This book is greatly improved by his keen eye for detail and unerring ability to sniff out waffle and vagueness.
I would also like to thank Adafruit, SparkFun, and CPC for supplying many of the modules and components used in the preparation of this book.
And last but not least, thanks once again to Linda, for her patience and generosity in giving me space to do this.
INTRODUCTION
Arduino has become the standard microcontroller used by makers, artists, and educators due to its ease of use, low cost, and plethora of interface boards (shields). Plug-in shields can be attached to the basic board, extending the Arduino into the Internet, robotic, and home automation realms. As well as official Arduino hardware, the many types of Arduino-compatible boards that can be programmed from the Arduino IDE mean that you can find a board that suits your projects requirements and cost constraints.