A Web Component to control an Arduino device.
- Download: Run
bower install web-arduino
ornpm install web-arduino
. - Import: Add
<link id="webArduino" rel="import" href="path/to/web-arduino/web-arduino.html">
in your Web app.
Blink a LED.
<web-arduino id="arduino" device-name="ARDUINO"></web-arduino>
<script>
var arduino = document.querySelector('#arduino');
arduino.onconnected = function() {
arduino.d7 = Arduino.HIGH;
setInterval(function() {
arduino.d7 = !arduino.d7;
}, 1000);
});
</script>
- Firefox OS 3.0.0.0-prerelease