O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming the Photon: Getting Started with the Internet of Things

Book Description

Explore the Internet of Things and build useful, functioning Photon projects

Quickly learn to construct your own electronics devices and control them over the Internet with help from this DIY guide. Programming the Photon: Getting Started with the Internet of Things features clear explanations and step-by-step examples that use inexpensive, easy-to-find components. Discover how to connect to Wi-Fi networks, attach hardware to I/O ports, write custom programs, and work from the cloud. You will learn how to troubleshoot and tweak your Photon creations—even interface with social media sites!

· Set up your Photon board and connect to the Particle cloud

· Start constructing and programming custom IoT projects

· Learn the syntax of both the C and Arduino languages

· Incorporate switches, sensors, and other input devices

· Control hardware through the Photon’s outputs

· Control your creations through the Internet

· Add functions with Particle shields and add-on boards

· Link real-time data to your board via the IFTTT Web Service

· Integrate with websites—Facebook, Twitter, Gmail, and more!

Table of Contents

  1. Cover Page
  2. Halftitle Page
  3. Title Page
  4. Copyright Page
  5. About the Author
  6. Contents at a Glance
  7. Contents
  8. Preface
  9. Acknowledgments
  10. Chapter 1 Introduction to the Photon
    1. Microcontrollers
    2. So, What Is the Photon?
    3. Particle Photon versus Spark Core
    4. The Internet of Things
    5. Particle Cloud
    6. The Photon Board
    7. Summary
  11. Chapter 2 Getting Connected
    1. Board Features
    2. Getting Connected
      1. Connecting to Mobile Smart Device
      2. Connecting over USB
    3. Using Tinker
      1. Tinker API
      2. Running Tinker Alongside Your Scripts
    4. Using the Particle Web IDE
      1. Particle Applications and Libraries
      2. Uploading Your First Application
      3. Account Information
      4. Using Libraries
    5. Photon’s Firmware
    6. Summary
  12. Chapter 3 Particle Syntax
    1. What Is Programming?
    2. Variables
      1. Floats
      2. Boolean
      3. Char
    3. Commands
      1. The if Statement
      2. for Loops
      3. while Loops
    4. Arrays
    5. Strings
    6. Coding Best Practices
      1. Indentation
      2. Commenting Your Code
      3. Whitespaces
    7. Summary
  13. Chapter 4 Outputs
    1. Digital Outputs
      1. Flashing an LED
      2. LCD Display
      3. Analog Outputs
    2. Summary
  14. Chapter 5 Inputs
    1. Digital Inputs
      1. digitalRead ()
      2. Analog Inputs
    2. Summary
  15. Chapter 6 The Internet of Things
    1. Functions
      1. Controlling an LED over the Internet
      2. Reading Values over the Internet
    2. Summary
  16. Chapter 7 Programming Particle Shields
    1. Shield Shield
    2. Relay Shield
    3. Programmer Shield
    4. Power Shield
    5. The Internet Button
    6. Grove Starter Kit for Photon
    7. Adafruit Particle NeoPixel Ring Kit
    8. Summary
  17. Chapter 8 IFTTT
    1. If This Then That
    2. Sunrise E-mail Alert
    3. Create a Twitter Alert Using Grove Modules
    4. Summary
  18. Chapter 9 Troubleshooting Your Device
    1. Device Modes
    2. Troubleshooting Modes
    3. Summary
  19. Appendix A Tools and Tips
    1. Breadboards and Prototyping Boards
    2. Multimeter
    3. Soldering
    4. Analog versus Digital
    5. Suppliers
    6. Components
      1. Resistors
      2. Semiconductors
      3. Hardware and Miscellaneous
  20. Appendix B Particle Code Reference
    1. Setup
    2. Loop
    3. analogRead
    4. analogWrite
    5. digitalRead
    6. digitalWrite
    7. if
    8. else
    9. int
    10. pinMode
    11. servo.attach
    12. servo.write
  21. Index