TinyWebServer
TinyWebServer copied to clipboard
Put variable
Can i put some arduino variables into web pages stored in SD card?
I'm not sure I understand your use case. Are you thinking of storing application data in files stored on the SD card? If so, yes, you should be able to.
I think he means data injection like AngularJS or Jade can do. For example, a webpage that tells you the current state of a pin, not necessarily real time updating like AngularJS would be able to do... but just on page load. I think you could make a nice simple web app on this tinywebserver that used AngularJS and a RESTful API that would be used to relay variable data.
@DubbyTT The BlinkLED example uses exactly that use case, except it's using jQuery instead of AngularJS. See the ledStatus
function in examples/BlinkLed/static/main.js, which makes a request to the Arduino web server, asking for the status of the LED. The function on the Arduino that gets executed is led_status_handler
in examples/BlinkLed/BlinkLed.ino.
If you want to use AngularJS, you'd need to return a JSON in the led_status_handler
, and obviously modify write the AngularJS code.