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