CxD Archive
Code: Internet of Things 2.0
Code: Internet of Things 2.0
  • 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
Export as PDF
  1. References

Particle Cloud

PreviousWeb App - Multiple ScreensNextWeb App Prep Steps

Last updated 2 years ago

The defining feature of an IoT device is its ability to send and receive information through the internet. This allows an IoT device to interact with other apps or other IoT devices. For this project, you'll be creating a web app that interacts with your Photon device through the internet.

All of your Photon's internet communications are routed through the Particle Cloud service, which offers these ways that a web app can interact with a Photon device through Particle Cloud:

  1. A web app can get the value of a Photon device variable

  2. A web app can call a custom function on a Photon device

  3. A web app can get event notifications from a Photon device

In order to make your Photon device interact with your web app, you'll need to add special code to both your Photon device app and your web app:

  • The Particle firmware on your Photon device has built-in cloud functions to allow your device to interact with a web app through Particle Cloud. You'll need to add code statements using these cloud functions in your Photon device app.

  • There is a Particle API JavaScript library that provides methods (functions) to allow your web app to interact with your Photon device app through Particle Cloud. You'll need to load this JS library in your web app's HTML file, and then add code statements using the library's methods in your web app's JavaScript file.