run your javascript app for years on a coin cell - jsconf.asia 2016

Post on 21-Apr-2017

1.381 Views

Category:

Internet

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Running your JS app

JSConf.asia 25 November 2016

for years on a coin cell

Developer EvangelistInternet of Things

JavaScript inside

We're using quad-core machines to run a temperature sensor

0.137 mA

220 mARaspberry Pi 3 (idle)

One year on AA battery

YES, WE CAN!

microcontrollers

mbedUnify microcontroller development > 100 boards supported Lot of APIs / libaries / community

But... in C++

Developed by Samsung JS VM for constrained devices

Can run in 64K of RAM

Written in C++

JavaScript on mbed

JS on mbed - Best of both worlds

• Runs on > 40 boards already

• Drivers, OS, critical paths in C++

• Deep sleep built-in

• Big library ecosystem, and many connectivity methods

• Application code can run in JS, and interop with C++

$gitclonehttps://github.com/armmbed/mbed-js-example

$gulp--target=NRF52_DK

#Dragfileontoboard(mountsasmassstorage)

1varled=DigitalOut(LED1);23setInterval(function(){4led.write(lead.read()?0:1);5},1000);

www.microbit.co.uk

Abstracting away many microcontroller 'problems'Thread management, interrupts, context switching, power management

0.137 mA

220 mARaspberry Pi 3 (idle)

One year on AA battery

0.020 mAJS on mbed beacon1s interval, lowest power mode, nRF52-DK

Current state

• > 40 boards supported (from 9$)

• Need C++ / JS bindings for libraries

• Apache 2.0 licensed

• Very beta... But please help us!

http://mbed.com/js

Thank you!http://mbed.com/js

@janjongboom

top related