I guess you could just write the example code like this :
<!doctype html> <script src="gpio.js"></script> <script> var v = 0; GPIO.getPort(196).then( function(port) { setInterval(toggleLight, 1000, port); } ); function toggleLight(port){ v = v ? 0 : 1; port.write(v); } </script>
[1] http://www.w3.org/TR/html-markup/
void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000); }
I guess you could just write the example code like this :
Just having the script tags would also probably works in most browsers but it wouldn't be standard compliant (if you care about it...).[1] http://www.w3.org/TR/html-markup/