Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Basic HTML page for talking to Particle Photon
<!-- Turn on/off eight LEDs connected to Particle Photon pins D0...D7 -->
<script src=""></script>
<script type="text/javascript">
function submitform( formNum )
var dataObj = {};
dataObj.args = formNum;
// the first string of random chars is the ID of your Photon. You can find this via by clicking the devices icon
// the second string (access_token) can be found under the Settings icon. When you regenerate the token, all former versions cease to work
$.post( "", dataObj, function( dataObj ) {
$( "#result" ).html( JSON.stringify(dataObj) );
return false;
<a href="javascript: submitform(1)">- 1 -</a>
<a href="javascript: submitform(2)">- 2 -</a>
<a href="javascript: submitform(3)">- 3 -</a>
<a href="javascript: submitform(4)">- 4 -</a>
<a href="javascript: submitform(5)">- 5 -</a>
<a href="javascript: submitform(6)">- 6 -</a>
<a href="javascript: submitform(7)">- 7 -</a>
<a href="javascript: submitform(8)">- 8 -</a>
<a href="javascript: submitform(10)">- off -</a>
<div id="result"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment