First, lets set up some global variables. These can be found under Variables and initialize globally. To this we will add a Text value to start with.

  1. Make sure the serverURL is set to “https://api.particle.io/v1/devices/“.
  2. Copy the Device ID and use that for the deviceID variable.
  3. Locate the Access Token from your Particle account and use that for the accessToken.
  4. Fun should be set to the function name from the Particle code. For this instance, we are calling “led”.
  5. Var is a placeholder for the value we will be sending to the function. It is blank.
  6. HTTP_Reply can be used to get a conformation message from the Particle device.
  7. PINstate can be used later to toggle the On/Off button.

This guide was first published on Jul 10, 2018. It was last updated on Jul 10, 2018.

This page (Set Global Variables) was last updated on May 12, 2021.

Text editor powered by tinymce.