Controlling output devices (with APIs)

Hope you have completed the steps given under Controlling output devices (Glowing an LED).

If yes then head over to your computer and open a web browser, we shall craft a URL that will turn on the LED.

Here are few points about this tutorial:

  • The URL connects to the Bolt IoT cloud
  • It uses your API key and device ID, then we pass a command to turn ON pin 0.
  • Command structure:
    • This command is called ‘digitalWrite’
    • We pass the command the pin number/name
    • Then the state HIGH, which means ‘on’ or LOW which means ‘off’.

So here is the URL:

https://cloud.boltiot.com/remote/YOUR API KEY/digitalWrite?pin=0&state=HIGH&deviceName=YOUR BOLT DEVICE ID

Type this URL, remembering to change the API and Bolt Device ID and press Enter.

Your LED will come to life! 💡 That was simple!

Now to turn it off, just change the HIGH in the URL to LOW.

Video on how to control the LED

Confused about the steps given above? Don't worry. Watch this video and it should help you.

📘

Thank you electromaker.io

This tutorial on Controlling output devices with Bolt APIs is inspired by the tutorial written by Les Pounder for electromaker.io. Thank you!


What’s Next

You may now continue to learn more about the Bolt APIs (How to interface input devices via the APIs and more) or build a cloud dashboard to control the LED.