# LED on/off example

**URL:** <https://community.particle.io/t/led-on-off-example/50523>\
**Category:** Troubleshooting\
**Created:** [June 19, 2019, 2:03pm UTC](https://community.particle.io/t/led-on-off-example/50523 "2019-06-19T14:03:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattMaxon](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mattmaxon/32/21925_2.png) [@MattMaxon](https://community.particle.io/u/MattMaxon)\
**Post date:** [June 19, 2019, 2:03pm UTC](https://community.particle.io/t/led-on-off-example/50523/1 "2019-06-19T14:03:19Z")

</div>

I am trying to get the LED example to work

I have the code loaded to the device and it works from the console.

Now the issue is controlling it from a webpage

[https://docs.particle.io/tutorials/hardware-projects/hardware-examples/boron/](https://docs.particle.io/tutorials/hardware-projects/hardware-examples/boron/)

I created a webpage with the code in the example with the “Device ID” and “Secret”

click the Turn on the LED

API…error blah blah blah “the access token was not found”

Obviously I am missing something fundamental here

---

<div class="post-metadata">

**Author:** ![ninjatill](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ninjatill/32/17370_2.png) [@ninjatill](https://community.particle.io/u/ninjatill)\
**Post date:** [June 19, 2019, 2:49pm UTC](https://community.particle.io/t/led-on-off-example/50523/2 "2019-06-19T14:49:48Z")

</div>

Could you clarify… Did you use _ **your** _ Device ID and Secret? How did you obtain your secret? Although I could assume from your description that you grabbed the secret from your console, the message that the token does not exist seems to indicate that the token is incorrect. Did you copy and paste the token? If so, check for extraneous characters, blank space, the length to make sure it matches, etc. For that matter, check the Device ID for the same issues. Are you able to run the CURL command from the example in a command prompt?

---

<div class="post-metadata">

**Author:** ![MattMaxon](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mattmaxon/32/21925_2.png) [@MattMaxon](https://community.particle.io/u/MattMaxon)\
**Post date:** [June 19, 2019, 9:58pm UTC](https://community.particle.io/t/led-on-off-example/50523/3 "2019-06-19T21:58:23Z")

</div>

Yeah used the device ID for my device from. The console for the device I am using a boron lte . The secret … I clicked on the finger print and selected simple authorization (web) added the URL for the webpage with the on / off do it!

---

<div class="post-metadata">

**Author:** ![MattMaxon](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mattmaxon/32/21925_2.png) [@MattMaxon](https://community.particle.io/u/MattMaxon)\
**Post date:** [June 19, 2019, 10:00pm UTC](https://community.particle.io/t/led-on-off-example/50523/4 "2019-06-19T22:00:16Z")

</div>

I’ll have to figure out what the CURL command is and get back to you

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [June 20, 2019, 4:59am UTC](https://community.particle.io/t/led-on-off-example/50523/5 "2019-06-20T04:59:57Z")

</div>

If you go to the settings tab in the Web IDE, you’ll find an access token. That’s (the) one you want to use.

---

<div class="post-metadata">

**Author:** ![MattMaxon](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mattmaxon/32/21925_2.png) [@MattMaxon](https://community.particle.io/u/MattMaxon)\
**Post date:** [June 21, 2019, 11:37am UTC](https://community.particle.io/t/led-on-off-example/50523/6 "2019-06-21T11:37:55Z")

</div>

Many unending thanks to you.

Still didn’t work until I noticed I deleted the “access\_token=” too

Now on to figuring out how to do a momentary push button or a pulse of on/off

Matt
