SlideShare a Scribd company logo
altering the real world
with JavaScript
Jan Jongboom
Framsia 23-09-2015
@janjongboom
Telenor R&D
Mozilla things
I hate
JavaScript!
VBScript
<3 <3 <3
Altering the real world with JavaScript - Framsia
Altering the real world with JavaScript - Framsia
BORING!
Altering the real world with JavaScript - Framsia
Accelerometer
Real purpose: Turn to mute
Juggling visualizer
Measure z-forces on device
Plot it in graph over time
Juggle with multiple devices
Juggling visualizer
1 window.addEventListener('devicemotion', function(e) {
2 var serie = getGraphSerieForDevice(e.data.deviceId);
3 serie.addPoint([ e.data.timestamp, Math.abs(e.data.z) ]);
4 });
Weight scale
Computer generated
music
Altering the real world with JavaScript - Framsia
http://gibber.mat.ucsb.edu/
1 a = Drums('x*o*x*o-')
Gibber
Gibber
1 a = Drums('x*o*x*o-')
2 a.pitch = 0.5
Gibber
1 a = Drums('x*o*x*o-')
2
3 speak = Speak({ pitch: 70, wordgap:5 })
4 .say.seq(
5 ['Mu', 'nich', 'Mu', 'Mu', 'nich'],
6 [1/2, 1/2, 1/4, 1/4, 1/2]
7 )
8
9 speak.pitch.seq( [1,.8,1.2].rnd() )
10 Clock.bpm = 120;
Gibber
1 a = Drums('x*o*x*o-')
2
3 speak = Speak({ pitch: 70, wordgap:5 })
4 .say.seq(
5 ['Mu', 'nich'],
6 [1/4, 1/4, 1/4, 1/2].rnd()
7 )
8
9 speak.pitch.seq( [1,.8,1.2].rnd() )
10 Clock.bpm = 120;
Gibber
1 a = Drums('x*o*x*o-')
2
3 speak = Speak({ pitch: 70, wordgap:5 })
4 .say.seq(
5 ['Mu', 'nich'],
6 [1/4, 1/4, 1/4, 1/2].rnd()
7 )
8
9 speak.pitch.seq( [1,.8,1.2].rnd() )
10 Clock.bpm = 120;
So much phones!
Altering the real world with JavaScript - Framsia
Gibber
Gibber
1 a = Drums('x*o*x*o-')
2 a.pitch = Phone.X
https://github.com/janjongboom/jsconf-us/blob/master/gibber/gibber-phone.js
Getting data out of the
real world
iBeacons
Broadcasting their existence
iBeacons
Long battery life
Cheap
Unique identifier
Coming to a web browser near you
https://bugzilla.mozilla.org/show_bug.cgi?id=1063444
Scanning beacons
1 var adapter = navigator.mozBluetooth.defaultAdapter
2 adapter.startLeScan([]).then(handle => {
3 handle.ondevicefound = e => {
4 // handle e.scanRecord
5 }
6
7 setTimeout(() => {
8 adapter.stopLeScan(handle)
9 }, 5000)
10 }, err => console.error(err))
JavaScript baby monitor
Tag your baby with a phone
Get three beacons
Some math
Altering the real world with JavaScript - Framsia
Physical Web
Walk up and use anything
Physical Web beacon
http://goo.gl/a1b4cd
Altering the real world with JavaScript - Framsia
http://rollingspider.xyz/aa73bc21
Drone Web App
Physical Web to discover
Web App gets reference to device
Connect using WebBluetooth
Fly!
10 // Set up the connection
11 e.device.gatt.connect().then(() => {
12 return e.device.gatt.discoverServices();
13 }).then(() => {
14 // devices have services, and services have characteristics
15 var services = e.device.gatt.services;
16 console.log('services', services);
17
18 // find the characteristic that handles flying the drone
19 var c = services.reduce((curr, f) => curr.concat(f.characteristics), [])
20 .filter(c => c.uuid === '9a66fa0b-0800-9191-11e4-012d1540cb8e')[0];
21
22 // take off instruction!
23 var buffer = new Uint8Array(0x04, counter++, 0x02, 0x00, 0x01, 0x00]);
24 c.writeValue(buffer).then(() => {
25 console.log('take off successful!');
26 });
27 });
-
Altering the real world with JavaScript - Framsia
Get hacking!
Grab a phone and use sensor data
Take beacon or Nordic dev kit
WebBluetooth is coming! Be prepared!
Thank you!
@janjongboom
https://github.com/janjongboom/(jsconf-asia|jsconf-us)
https://hacks.mozilla.org/?p=29166

More Related Content

PDF
Fun with sensors - JSConf.asia 2014
PDF
GAN을 활용한, 내 손글씨를 따라쓰는 인공지능: 나 혼자서 딥러닝 A to Z
ODP
Use of django at jolt online v3
PDF
MongoDB World 2019: Event Horizon: Meet Albert Einstein As You Move To The Cloud
PPTX
How to autorun graphic application
PPTX
我在 Mac 上的常用开发工具
PDF
Snake game ai presentation
PDF
ES6 generators
Fun with sensors - JSConf.asia 2014
GAN을 활용한, 내 손글씨를 따라쓰는 인공지능: 나 혼자서 딥러닝 A to Z
Use of django at jolt online v3
MongoDB World 2019: Event Horizon: Meet Albert Einstein As You Move To The Cloud
How to autorun graphic application
我在 Mac 上的常用开发工具
Snake game ai presentation
ES6 generators

Similar to Altering the real world with JavaScript - Framsia (20)

PDF
DomCode 2015 - Abusing phones to make the internet of things
PDF
Altering the real world with JavaScript - JSConf.US 2015
PDF
Let's Get Physical
PDF
The Physical World meets the Web
PPTX
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
PDF
Javascript all the things
PDF
Cold front - bridging the web and the physical world
PDF
DAHO.AM 2015 - Abusing phones to make the internet of things
PDF
Getting physical with web bluetooth in the browser hackference
PDF
Fun with JavaScript and sensors - AmsterdamJS April 2015
PDF
JavaScript in the Real World
PDF
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
PDF
Getting physical with web bluetooth in the browser
PPTX
Academy PRO: HTML5 API multimedia
PDF
Exploring the physical web
PDF
How To Electrocute Yourself using the Internet
PPTX
MTA java script coding for the touch interface
PDF
Physical web inside and out final
PDF
Getting physical with web bluetooth in the browser
PDF
Prototyping Hardware
DomCode 2015 - Abusing phones to make the internet of things
Altering the real world with JavaScript - JSConf.US 2015
Let's Get Physical
The Physical World meets the Web
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
Javascript all the things
Cold front - bridging the web and the physical world
DAHO.AM 2015 - Abusing phones to make the internet of things
Getting physical with web bluetooth in the browser hackference
Fun with JavaScript and sensors - AmsterdamJS April 2015
JavaScript in the Real World
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting physical with web bluetooth in the browser
Academy PRO: HTML5 API multimedia
Exploring the physical web
How To Electrocute Yourself using the Internet
MTA java script coding for the touch interface
Physical web inside and out final
Getting physical with web bluetooth in the browser
Prototyping Hardware
Ad

More from Jan Jongboom (20)

PDF
TinyML on Arduino - workshop
PDF
Intelligent Edge - Getting started with TinyML for industrial applications
PDF
Teaching your sensors new tricks with Machine Learning - Eta Compute webinar
PDF
Get started with TinyML - Embedded online conference
PDF
Adding intelligence to your LoRaWAN deployment - The Things Virtual Conference
PDF
Get started with TinyML - Hackster webinar 9 April 2020
PDF
Tiny intelligent computers and sensors - Open Hardware Event 2020
PDF
Teaching your sensors new tricks with Machine Learning - CENSIS Tech Summit 2019
PDF
Adding intelligence to your LoRaWAN devices - The Things Conference on tour
PDF
Machine learning on 1 square centimeter - Emerce Next 2019
PDF
Fundamentals of IoT - Data Science Africa 2019
PDF
17,000 contributions in 32K RAM - FOSS North 2019
PDF
Open Hours: Mbed Simulator
PDF
Efficient IoT solutions based on LoRaWAN, The Things Network and Mbed OS
PDF
Machine learning on 1 cm2 - Tweakers Dev Summit
PDF
Simulating LoRaWAN devices - LoRa Alliance AMM 2019
PDF
Develop with Mbed OS - The Things Conference 2019
PDF
Firmware Updates over LoRaWAN - The Things Conference 2019
PDF
Faster Device Development - GSMA @ CES 2019
PDF
Mbed LoRaWAN stack: a case study - LoRa Alliance AMM Tokyo
TinyML on Arduino - workshop
Intelligent Edge - Getting started with TinyML for industrial applications
Teaching your sensors new tricks with Machine Learning - Eta Compute webinar
Get started with TinyML - Embedded online conference
Adding intelligence to your LoRaWAN deployment - The Things Virtual Conference
Get started with TinyML - Hackster webinar 9 April 2020
Tiny intelligent computers and sensors - Open Hardware Event 2020
Teaching your sensors new tricks with Machine Learning - CENSIS Tech Summit 2019
Adding intelligence to your LoRaWAN devices - The Things Conference on tour
Machine learning on 1 square centimeter - Emerce Next 2019
Fundamentals of IoT - Data Science Africa 2019
17,000 contributions in 32K RAM - FOSS North 2019
Open Hours: Mbed Simulator
Efficient IoT solutions based on LoRaWAN, The Things Network and Mbed OS
Machine learning on 1 cm2 - Tweakers Dev Summit
Simulating LoRaWAN devices - LoRa Alliance AMM 2019
Develop with Mbed OS - The Things Conference 2019
Firmware Updates over LoRaWAN - The Things Conference 2019
Faster Device Development - GSMA @ CES 2019
Mbed LoRaWAN stack: a case study - LoRa Alliance AMM Tokyo
Ad

Recently uploaded (20)

PPTX
artificial intelligence overview of it and more
PPTX
Introduction to cybersecurity and digital nettiquette
PDF
Uptota Investor Deck - Where Africa Meets Blockchain
PPTX
E -tech empowerment technologies PowerPoint
PPTX
Funds Management Learning Material for Beg
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
PPTX
Database Information System - Management Information System
PPTX
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PPTX
Internet Safety for Seniors presentation
PDF
simpleintnettestmetiaerl for the simple testint
PPTX
newyork.pptxirantrafgshenepalchinachinane
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PDF
Session 1 (Week 1)fghjmgfdsfgthyjkhfdsadfghjkhgfdsa
PPTX
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PDF
Introduction to the IoT system, how the IoT system works
PDF
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
DOC
Rose毕业证学历认证,利物浦约翰摩尔斯大学毕业证国外本科毕业证
artificial intelligence overview of it and more
Introduction to cybersecurity and digital nettiquette
Uptota Investor Deck - Where Africa Meets Blockchain
E -tech empowerment technologies PowerPoint
Funds Management Learning Material for Beg
The New Creative Director: How AI Tools for Social Media Content Creation Are...
The Ikigai Template _ Recalibrate How You Spend Your Time.pdf
Database Information System - Management Information System
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
Mathew Digital SEO Checklist Guidlines 2025
Internet Safety for Seniors presentation
simpleintnettestmetiaerl for the simple testint
newyork.pptxirantrafgshenepalchinachinane
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
Session 1 (Week 1)fghjmgfdsfgthyjkhfdsadfghjkhgfdsa
1402_iCSC_-_RESTful_Web_APIs_--_Josef_Hammer.pptx
SASE Traffic Flow - ZTNA Connector-1.pdf
Introduction to the IoT system, how the IoT system works
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
Rose毕业证学历认证,利物浦约翰摩尔斯大学毕业证国外本科毕业证

Altering the real world with JavaScript - Framsia