WoT.JS

WoT.JS is a library provides a easy and fast way to build IoT(Internet of Things) applications for hackers. You just can control devices so easily like doing programming with pure Web technology.

Concepts

  • A device is represented as a element in a Web page.
  • An IoT app is just a Web app, hackers can control multiple devices in it.
  • Only JavaScript code, no native(C/C++) code to build an IoT app.

Brief Look

Light a LED without code.

1
2
3
<web-arduino id="arduino" device-name="DEVICE">
  <pin index="7" mode="OUTPUT" value="HIGH"></pin>
</web-arduino>
Examples

Examples

Blink LED

1
2
3
<web-arduino id="light" device-name="DEVICE">
  <pin index="7" mode="OUTPUT" value="HIGH"></pin>
</web-arduino>
1
2
3
4
5
6
7
var light = document.querySelector('#light');

light.addEventListener('connected', function() {
  setInterval(function() {
    light.d7 = !light.d7;
  }, 300);
});

Add a button

Button

1
<web-arduino id="button" device-name="DEVICE"></web-arduino>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
var button = document.querySelector('#button');

button.addEventListener('connected', function() {
  button.subscribe(7);
});

button.addEventListener('digitalpinchanged', function(evt) {
  var pin = evt.detail.pin;
  console.log('The value of' + pin.name + ': ' + pin.value);
});
Get Started

Get Started

On Working…

Leave your email, we’ll let you know once we done it.

Get Code

Get Code

  • Web Arduino: A Web Component to control an Arduino device.
  • Bluetooth Helper: A wrapper for BLE APIs in FxOS. It help developers handle BLE things easier.
Authors

Authors

Evan Tseng

GitHub, Email