Skip to content
Example control of the spark core and perhaps photon with a simple html web page
HTML Other
  1. HTML 87.6%
  2. Other 12.4%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
xtra-html-ajax-json-slider-polling.html Photon (formerly Core)-web-page-html-control

Working link at

Update: Feb 2017 This site has been tested with students and works fine but I am making a more up-to-date site at

An installation video of all but the recent stuff is at

Instructional video

Dec 15, 2015

I just added an index.html for (remember that spark-web.ino still needs to be flashed to the photon for a webpage to be able to communicate with it.)

Update Oct 28, 2015 As this reposiotory is getting bloated and badly named since has changed to and the Spark Core is now gone replaced with the Photon. I have moved this repository to

update Oct 15, 2015

Arrgh! An update on the Photon has left this code not working for AnalogRead. It seems that for the new Photon. AnalogRead can not have the pinmode set. I have change the simple-web.ino to reflect this issue. It should work now.

update Oct 13, 2015 PWM send (write) for analog only works with this setup for pins A4, A5.

DAC1,2 A3 and A6 have some cool direct voltage thing that presently is not working. Analog read should work on all pins A0 - A7 but it is having some issues.

Digital read and write is doing fine.

update Oct 2015

Oops. simple.html does not allow any read functions to work. Back to the drawing board, I need to make the AJAX base more simple. So I made the AjaxBetter.html file that should be the one everybody uses. It is as easy as it gets while still returning analog or digital read information. Refer to the more complex xtra-ajax-json-slider-polling.html for Polling or a working slider.

Update Sep 7, 2015

Made simple.html since a youtube user wanted an easier version of the webpage that just uses buttons to activate the photon

Example control of the spark core and perhaps photon with a simple html web page

Dec 12, 2014 Can't really believe that it worked, but it does. You need to find your access token in the spark settings page at the bottom left of your spark IDE screen.

You then need the Core Device ID which is harder to find. You have to go to the core then click on your cores ">" sign beside the flashing blue dot.

Then just call the function you want to activate. Travels at the speed of your connection which can be fast or up to a few seconds.

Wow. Very happy.

Finished Jan 5, 2015

The files are:

  1. simple.html (latest update). Much easier webpage for controlling the Photon or Core

  2. spark-control-basic-web-page.html Control a spark device using regular html a form, iframe and local storage.

  3. spark-web.ino the spark file that must be flashed to the device

  4. useless.ino the bare essential spark activation but uses up the four possible spark functions. Simple but useless

  5. xtra-ajax-json-slider-polling.html a more advanced much better than the basic web page still only uses javascript and html but is more efficient.

Both HTML files can be loaded onto phonegap build to make Android and iOS Apps that activate spark devices.

Use at your own risk.

By Jeremy Ellis the maker of

twitter @rocksetta

You can’t perform that action at this time.