BAREMETALJAVASCRIPT
C o n n e c t e d s o l u t i o n s & d i g i t a l s e r v i c e s
Frederik Vannieuwenborg – 29/10/2015
IN LINUX
& GPIO PROGRAMMING
WHO AM I?
Frederik Vannieuwenborg
Technical Partner Aptus
Media & Communication Technology
Zwevegem
@vannieuwenborgf
What we do?
We combine hardware (electronics) and software (embedded software, cloud, mobile and web
applications) with connectivity solutions to help connect devices and people and processes.
HARDWARE
PROTOTYPE
WIRELESS COMM.
ELECTRONICS
MICROCONTROLLER
A BRIDGE BETWEEN THE PHYSICAL
AND DIGITAL WORLD
INTERACTION BETWEEN INTERNET,
THINGS AND DATA
DATA
Internet
Things
CLOUD
BIG DATA
EMBEDDED
SOFTWARE
MOBILE APPS
HTML5/CSS3/JS
DEVICES & MACHINES
ENVIRONMENTS
PEOPLE
Sensor networks
Indoor positioning
LPWAN
Wearables
RFID/NFC
BARE METAL
JAVASCRIPT
It’s all about using JavaScript
on micro-controller boards or
single-board computers
Agenda
NodeJS FrameworksHardware Frameworks FrameworksDemo
Bare metal Javascript & GPIO programming in Linux
- Server-side JavaScript runtime
- Built on Chrome's V8 JavaScript engine
- Non-blocking I/O
- Single threaded
- Event driven
- Async
Node.js
Bare metal Javascript & GPIO programming in Linux
BlockingI/O
Non-blockingI/O
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337/');
Basic examples
var fs = require('fs');
fs.readFile(‘somefile.txt', 'utf8', function(err, contents) {
console.log(contents);
});
Application JavaScript Code
Node.js JavaScript built-in library
Node.js C++ Layer
libuv OpenSSL zlib c-ares
The Node.jsinternals
The Node.jssystem
APPLICATION
V8
(JAVASCRIPT ENGINE)
NODE.JS
BINDINGS
(NODE API)
JAVASCRIPT
OS
OPERATION
LIBUV
(ASYNCHRONOUS I/O)
EVENT
QUEUE
WORKER
THREADS
FILE SYSTEM
NETWORK
PROCESS
EVENT
LOOP
BLOCKING
OPERATION
EXECUTE
CALLBACK
Don’tuse Node.js for…
- CPU intensive tasks
- Long running CPU tasks will block the whole server
- File-processing
- Multi-threaded processing
- You can run multiple Node processes running in
parallel though
Command line utility to install Node.js packages, do version
management and dependency management of Node.js packages.
HARDWARE
IntelEdison
IntelEdison
- 32-bit Intel® Atom™ Processor @ 500 MHz
- 1 GBRAM LPDDR3 memory
- 4 GB storage
- Wireless Dual-band (2.4 and 5 GHz) & Bluetooth
- Connector 70-pin Hirose
- USB 2.0 1 OTG controller
- I/O 40 general purpose GPIO
- 4 capable of PWM
Bare metal Javascript & GPIO programming in Linux
IntelEdison – Arduino breakout Kit
IntelEdison – Sparkfun block
Bare metal Javascript & GPIO programming in Linux
Bare metal Javascript & GPIO programming in Linux
// Load Grove module
var groveSensor = require('jsupm_grove');
// Create the button object using GPIO pin 0 var
button = new groveSensor.GroveButton(0);
// Read the input and print, waiting one second
between readings
function readButtonValue() {
console.log(button.name() + " value is " +
button.value());
}
setInterval(readButtonValue, 1000);
var LEDBar = require("jsupm_my9221");
var myLEDBar = new LEDBar.MY9221(2, 3);
var directionBool = true;
var myInterval = setInterval(function() {
show_LED(1, directionBool);
}, 1000 );
function show_LED(level, direction) {
if (level <= 10) {
myLEDBar.setBarLevel(level, directionBool);
setTimeout(show_LED, 50, ++level, directionBool);
} else directionBool = !directionBool;
}
process.on('SIGINT', function() {
myLEDBar.setBarLevel(0, true);
clearInterval(myInterval);
console.log("Exiting..."); process.exit(0);
});
var groveSensor = require('jsupm_grove'); var
led = new groveSensor.GroveLed(2);
console.log(led.name());
var i = 0;
var waiting = setInterval(function() {
if ( i % 2 == 0 ) {
led.on();
} else {
led.off();
} i++;
if ( i == 20 ) clearInterval(waiting);
}, 1000);
Tessel.io
Tessel.io
- 2 Module ports
- 2 USB ports
- Wifi & Ethernet
- 580MHz Mediatek MT7620n
- 64 MB RAM & 32 MB Flash
- 48MHz Atmel SAMD21 co-
processor
- microUSB
Bare metal Javascript & GPIO programming in Linux
Bare metal Javascript & GPIO programming in Linux
Bare metal Javascript & GPIO programming in Linux
Beaglebone black
Beaglebone black
- Produced by Texas Instruments in association with Digi-
Key and Newark element14
- AM335x 1GHz ARM® Cortex-A8 & 512MB DDR3 RAM
- 4GB 8-bit eMMC on-board flash storage
- 3D graphics accelerator
- 2x PRU 32-bit microcontrollers
- USB client host
- Ethernet & HDMI
- 2x 46 pin headers
Beaglebone black
- Debian
- Android
- Ubuntu
- Cloud9 IDE on Node.js w/ BoneScript library
BoneScript is a Node.js library specifically optimized
for the Beagle family and featuring familiar Arduino
function calls, exported to the browser.
Cloud9IDE
http://elinux.org/Beagleboard:BeagleBone_Capes
Raspberry PI
Raspberry PI
- Low cost credit-card sized computer
- 900MHz quad-core ARM Cortex-A7 CPU
- 1GB RAM
- 4 USB ports
- Full HDMI port, Ethernet port
- Combined 3.5mm audio jack and composite video
- Camera interface (CSI) & Display interface (DSI)
- Micro SD card slot
- VideoCore IV 3D graphics core
Raspberry PI
- Default: Debian
- The Raspberry Pi Internet of Things Framework
- http://webiopi.trouch.com/
- The ThingBox Project
- Use Internet of Things technologies without any
technical knowledge and for free
- http://thethingbox.io/
Bare metal Javascript & GPIO programming in Linux
Bare metal Javascript & GPIO programming in Linux
FRAMEWORKS
Bare metal Javascript & GPIO programming in Linux
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
// Create a standard `led` instance
var led = new five.Led(13);
// "blink" the led in 500ms
led.blink(500);
});
*The JavaScript program is executed on a host machine that runs node.js
Cylon.js is a JavaScript framework for robotics,
physical computing, and the Internet of Things. It
makes it incredibly easy to command robots and
devices.
Cylon.js
- Connects 36 platforms
- Raspberry PI, Arduino, Pebble, …
- Drivers for General Purpose
Input/Output hardware
- LED, buttons, sensors, …
- Node based
Cyclon.js - demo
- Push button
- Log “Push button”
- Toggle LED
- Run “ToggleLed”
- Log “ToggleLed”
- Toggle LED
Node-RED is a tool for wiring together hardware
devices, APIs and online services in new and
interesting ways.
http://flows.nodered.org/
Node-REDflows
De geldfretter
Architectuur
Raspbian
NodeJS
Node-RED
LDR
LED
SERVO
Node-REDinstallation
http://nodered.org/docs/hardware/raspberrypi.html
*No support for node 4.x
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash
DOWNLOAD INSTALL SCRIPT
sudo apt-get install -y build-essential python-dev python-rpi.gpio nodejs
INSTALLATION
nodejs
START NODEJS
npm cache clean
sudo npm install -g node-red
INSTALL NODE-RED
sudo node-red
START NODE-RED
http://pi.gadgetoid.com/pinout
Raspberry PI – I/O Pinout
Light-EmittingDiode
Light-dependent resistor (LDR)
Servo
Servo for dummies
T’ligtgeldip,incaseern zeggek! (hands-on)
OH..
ONE MORE THING
Help us,we need your support!
Aptus HQ
Veldkant 33b
2550 Kontich
Aptus Offices
Stedestraat 51
8530 Harelbeke
Frederik Vannieuwenborg
http://twitter.com/WeAreAptus
http://www.aptus.be
Let’s talk!

More Related Content

PDF
Road to Republic of IoT - ESP32 Programming and LoRa
PDF
Internet of Things - Technicals
PDF
Playing with arduino open source h/w for mobile-centric services
PDF
Echelon Indonesia 2016 - Innovation Through Opportunities in IoT & Arduino
PDF
IT Solution through IoT Development
PDF
Hands-on Labs: Raspberry Pi 2 + Windows 10 IoT Core
PDF
Boards for the IoT-Prototyping
PDF
Introduction to AIoT & TinyML - with Arduino
Road to Republic of IoT - ESP32 Programming and LoRa
Internet of Things - Technicals
Playing with arduino open source h/w for mobile-centric services
Echelon Indonesia 2016 - Innovation Through Opportunities in IoT & Arduino
IT Solution through IoT Development
Hands-on Labs: Raspberry Pi 2 + Windows 10 IoT Core
Boards for the IoT-Prototyping
Introduction to AIoT & TinyML - with Arduino

What's hot (20)

PPTX
Introduction to Internet of Things Hardware
PPTX
Lab Handson: Power your Creations with Intel Edison!
PDF
Esp32 cam arduino-123
PDF
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
PPTX
DIY Science using the Intel IoT Developer Kit
PDF
Interacting with Intel Edison
PPTX
IOT Talking to Webserver - how to
PDF
Bandung IoT Maker Day #3 - Maker Movement
PDF
GDG Dev Fest - Develop with Firebase and IoT
PDF
Arduino vs Raspberry Pi | Which Board to Choose for IoT Projects | IoT Device...
PDF
IoT Getting Started with Intel® IoT Devkit
PDF
Get in Touch with Internet of Things
PDF
Internet of Things - Technological Perspective
PDF
Ruby Arduino (RubyConfIndia 2013)
PPTX
GeoDC Maker Talks: GPS-Enabled Sensor Platforms using Arduino
PDF
Show & Tell.- Introduction
PDF
The Rise of Maker Movement in Indonesia
PPTX
Microsoft's view of the Internet of Things (IoT) by Imran Shafqat
PPTX
Arduino1.0 RC
PPTX
Getting started with Intel IoT Developer Kit
Introduction to Internet of Things Hardware
Lab Handson: Power your Creations with Intel Edison!
Esp32 cam arduino-123
Raspberry Pi 2 + Windows 10 IoT Core + Node.js
DIY Science using the Intel IoT Developer Kit
Interacting with Intel Edison
IOT Talking to Webserver - how to
Bandung IoT Maker Day #3 - Maker Movement
GDG Dev Fest - Develop with Firebase and IoT
Arduino vs Raspberry Pi | Which Board to Choose for IoT Projects | IoT Device...
IoT Getting Started with Intel® IoT Devkit
Get in Touch with Internet of Things
Internet of Things - Technological Perspective
Ruby Arduino (RubyConfIndia 2013)
GeoDC Maker Talks: GPS-Enabled Sensor Platforms using Arduino
Show & Tell.- Introduction
The Rise of Maker Movement in Indonesia
Microsoft's view of the Internet of Things (IoT) by Imran Shafqat
Arduino1.0 RC
Getting started with Intel IoT Developer Kit
Ad

Viewers also liked (20)

PDF
Part 3 - Case studies
PPT
Wat is nitric oxide slidshare heart health presentatie
PPS
áZsia(2)+ani (nx power lite)
PDF
Interestingstuff 140324102450-phpapp02
PDF
Astek Academy SEO Bootcamp Checklist 2/25/12
PPS
Arany kezek(9)+ani (nx power lite)
PPTX
Grey matters final
PPT
'00s sunday night series
PDF
보건산업안전학과 2009180929김준수1
PPT
Лекции по УЭРу 5 курс 9 семестр ПГУПС
PPT
Let's guess the name of the hidden animals
PDF
Vastgoed sales cycle
PPS
簡樸使我富足
PDF
Module 1: The role of online services
PDF
4 q10 presentation
PPT
I amable sixty second tv psa script draft
PDF
Jimini deck
PPTX
Presentacióncondiapositivas
PPS
肝臟
PDF
Nganh oto 140716_dnse
Part 3 - Case studies
Wat is nitric oxide slidshare heart health presentatie
áZsia(2)+ani (nx power lite)
Interestingstuff 140324102450-phpapp02
Astek Academy SEO Bootcamp Checklist 2/25/12
Arany kezek(9)+ani (nx power lite)
Grey matters final
'00s sunday night series
보건산업안전학과 2009180929김준수1
Лекции по УЭРу 5 курс 9 семестр ПГУПС
Let's guess the name of the hidden animals
Vastgoed sales cycle
簡樸使我富足
Module 1: The role of online services
4 q10 presentation
I amable sixty second tv psa script draft
Jimini deck
Presentacióncondiapositivas
肝臟
Nganh oto 140716_dnse
Ad

Similar to Bare metal Javascript & GPIO programming in Linux (20)

PPTX
Hacking into IoT using JavaScript
PDF
Little bits & node.js IOT for beginner
PDF
How To Electrocute Yourself using the Internet
PDF
Hardware Hacking for JavaScript Engineers
PDF
Building Droids with JavaScript
PPTX
Controlling robots using javascript
PPTX
JavaScript Robotics #NodeWeek
PDF
Html5 game, websocket e arduino
PDF
Droids, java script and web connected hardware
PPTX
IoT Application Development
PDF
Html5 game, websocket e arduino
PPTX
Final Presentation - Edan&Itzik
PPT
IoT with Arduino
PDF
[HTML5DevConf SF] Hardware Hacking for Javascript Developers
PPTX
JavaScript and Internet Controlled Electronics
PDF
Home automation with javascript
PDF
Hardware for JavaScript Developers
PDF
Nodebot: Arte de controlar arduino com javascript
PDF
NodeMCU 0.9 Manual using Arduino IDE
PPTX
Arduino interfacing with bluetooth.
Hacking into IoT using JavaScript
Little bits & node.js IOT for beginner
How To Electrocute Yourself using the Internet
Hardware Hacking for JavaScript Engineers
Building Droids with JavaScript
Controlling robots using javascript
JavaScript Robotics #NodeWeek
Html5 game, websocket e arduino
Droids, java script and web connected hardware
IoT Application Development
Html5 game, websocket e arduino
Final Presentation - Edan&Itzik
IoT with Arduino
[HTML5DevConf SF] Hardware Hacking for Javascript Developers
JavaScript and Internet Controlled Electronics
Home automation with javascript
Hardware for JavaScript Developers
Nodebot: Arte de controlar arduino com javascript
NodeMCU 0.9 Manual using Arduino IDE
Arduino interfacing with bluetooth.

More from Alexander Vanwynsberghe (9)

PDF
The future of HealthCare is digital
PDF
Healthcare is shifting gears
PPTX
Eindwerk Social Media Consultant - SBM Case
PPTX
The social (r)evolution introduced by Generation Y
PPTX
The future of work with Office 365
PPTX
Taking your version control to a next level with TFS and Git
PDF
TFS on azure in 10 minutes
PPTX
Improved software testing using Visual Studio and TFS 2010
PPTX
Techdays 2011 - Things I will remember
The future of HealthCare is digital
Healthcare is shifting gears
Eindwerk Social Media Consultant - SBM Case
The social (r)evolution introduced by Generation Y
The future of work with Office 365
Taking your version control to a next level with TFS and Git
TFS on azure in 10 minutes
Improved software testing using Visual Studio and TFS 2010
Techdays 2011 - Things I will remember

Recently uploaded (20)

PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PDF
Website Design Services for Small Businesses.pdf
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
Visual explanation of Dijkstra's Algorithm using Python
PPTX
Computer Software - Technology and Livelihood Education
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Topaz Photo AI Crack New Download (Latest 2025)
Advanced SystemCare Ultimate Crack + Portable (2025)
Monitoring Stack: Grafana, Loki & Promtail
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
Autodesk AutoCAD Crack Free Download 2025
Salesforce Agentforce AI Implementation.pdf
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Website Design Services for Small Businesses.pdf
DNT Brochure 2025 – ISV Solutions @ D365
Patient Appointment Booking in Odoo with online payment
CNN LeNet5 Architecture: Neural Networks
CCleaner 6.39.11548 Crack 2025 License Key
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Computer Software and OS of computer science of grade 11.pptx
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Visual explanation of Dijkstra's Algorithm using Python
Computer Software - Technology and Livelihood Education

Bare metal Javascript & GPIO programming in Linux

Editor's Notes

  • #8: It’s all about using JavaScript on micro-controller boards or single-board computers
  • #9: Agenda: baremetal javascript
  • #10: Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
  • #46: Frameworks