Code: Internet of Things
  • Code Introduction
  • Prerequisite Knowledge
  • Tutorials
    • A. Meet Your IoT Kit
      • A-1 Circuit Board
      • A-2 Other Components
      • A-3 Electronic Circuits
    • B. Hello World Test
      • B-1 Start IoT Device
      • B-2 Login to Web IDE
      • B-3 New App Template
      • B-4 Global Variable
      • B-5 Setup Function
      • B-6 Loop Function
      • B-7 Flash App to Device
      • B-8 Modify App
    • C. Smart Light Device
      • C-1 Connect LED
      • C-2 Copy Hello World App
      • C-3 Connect Button
      • C-4 Add Button Code
      • C-5 Modify Button Code
      • C-6 Particle Cloud Code
      • C-7 Web App HTML
      • C-8 Web App CSS
      • C-9 Web App JS
    • D. Smart Security Device
      • D-1 Connect Motion Sensor
      • D-2 Connect Speaker
      • D-3 LED and Button Code
      • D-4 Motion Sensor Code
      • D-5 Speaker Code
      • D-6 Particle Cloud Code
      • D-7 Web App HTML
      • D-8 Web App CSS
      • D-9 Web App JS
  • References
    • Particle Build
    • Photon Device App
    • Web App - Single Screen
    • Web App - Multiple Screens
    • Particle Cloud
      • Web App Prep Steps
      • Get Device Variable
      • Call Device Function
      • Get Device Events
    • Physical Inputs
      • Push Buttons
      • Trimpot Dial
      • Motion Sensor
      • Magnetic Switch
      • Light Sensor
      • Temperature Sensor
      • Soil Moisture Sensor
      • Accelerometer
      • Ultrasonic Sensor *
    • Physical Outputs
      • LED Lights
      • Speaker
      • Servo Motor
      • Micro OLED Display
  • Links
    • IoT Project Guidebook
    • Particle Build (Web IDE)
    • Wiring Language
    • Photon Firmware
    • Particle API JS
    • W3Schools
    • Photon Kit Experiments
Powered by GitBook
On this page
  • What's in this Guidebook?
  • Your IoT Electronics Kit
  • Copyright and License

Code Introduction

NextPrerequisite Knowledge

This IoT Code Guidebook is a supplement the .

What's in this Guidebook?

This guidebook contains a series of IoT code tutorials to help you get familiar with using your IoT electronics kit to build smart devices and program apps for them.

In addition, this guidebook contains coding references to help show and explain how to create a device app and web app that interact with each other through the internet. There are also references that show and explain how to connect specific inputs and outputs to your device and how to add code in your device app to control the inputs and outputs.

Finally, this guidebook also contains links to external resources, such as an online code editor (web IDE) for creating your device app, programming language references, and additional experiments for learning how to use your IoT kit.

Be sure to check out the recommended that will help ensure students are successful with the IoT code tutorials and IoT project.

HOW TO COPY CODE: When using these coding tutorials and references, you can copy a code block by clicking the copy icon displayed in the upper-right corner of the code block.

// example code block

void setup() {
​
}
​
void loop() {
​
}

Your IoT Electronics Kit

Copyright and License

Copyright © 2016-2021 Michael Frontz and Jim Lyst, Indiana University School of Informatics and Computing at IUPUI

This guidebook is tailored for an IoT electronics kit called the , which will simply be referred to as the Photon kit.

SparkFun sells a variety of other sensors and outputs that can be used with the Photon kit. If possible, it is highly recommended to add an to the kit for more design possibilities.

NOTE: Your instructor may have provided you with a different IoT electronics kit. If your IoT kit uses Arduino, then you can still use this guidebook to help get familiar with using your IoT kit to build smart devices and program apps for them. The Photon kit is programmed using a language called that is nearly identical to . In addition, the is similar to an Arduino circuit board (though there are a few differences).

FYI: This IoT code tutorial focuses on coding web apps (using JavaScript) that interact with a Photon device. However, it is also possible to code (using Objective-C, Swift, or Java) that interact with a Photon device.

This material is part of the high school computer science curriculum developed for the program, an award-winning community partnership in central Indiana that is broadening student participation in computing and helping students develop the skills essential for success in the 21st century workplace. The iDEW program is managed by the .

This work is licensed under a . You are free to use, share, or adapt this material for noncommercial purposes as long as you provide proper attribution and distribute any copies or adaptations under this same license.

IoT Project Guidebook
prerequisite knowledge
SparkFun Inventor's Kit for Photon
ultrasonic sensor
Wiring
Arduino
Photon circuit board
native mobile apps for iOS and Android
Computing by Design
Informatics Diversity-Enhanced Workforce (iDEW)
Indiana University School of Informatics and Computing at IUPUI
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons License