I want to use a Particle Core or Photon to run a robot. I found projects that use ESP 8266 to run robots over a WiFi, so I though it would be nice to use the Particles I have around. First I controlled the robot using the Cloud (Particle Build and Console), but there is too much lag to be very useful for driving a robot.
My next approach is to have have the Particle serve up a simple web page with buttons for control on my local WiFi. This has been frustrating.
I modified and flashed TINYWEBSERVER.INO successfully
What I cannot figure out is how the Particle can respond to button pushes on the web page. I’d like to start with a “Push to Toggle LED” button.
I’ve looked through the documentation and found these:
Webpages on Photon / SoftAP Web pages on Photon/SoftAP. This documentation has a page callback function in the documentation with “an example”. The discussion is focused on how to connect to a Particle to a Wifi. I need something simpler.
This it too complicated. The “Complete Example” is virtually impossible to understand. And, BTW, it is not complete because it has no setup and loop functions.
I can follow (with difficulty) the HTML page that is stored as one long string. I cut and pasted it into an editor and manually broke it into lines.
I guess it works, but it is not very helpful for my much simpler task.
What do I need to just push a button on a served web page, and turn an LED on and off?