Right Money Management App For Your Financial Goals
Bare metal Javascript & GPIO programming in Linux
1. 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
2. WHO AM I?
Frederik Vannieuwenborg
Technical Partner Aptus
Media & Communication Technology
Zwevegem
@vannieuwenborgf
3. 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
17. 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
18. Command line utility to install Node.js packages, do version
management and dependency management of Node.js packages.
27. // 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);
28. 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);
});
29. 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);
36. 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
37. 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.
41. 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
42. 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/
47. 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
48. 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.
49. Cylon.js
- Connects 36 platforms
- Raspberry PI, Arduino, Pebble, …
- Drivers for General Purpose
Input/Output hardware
- LED, buttons, sensors, …
- Node based
50. Cyclon.js - demo
- Push button
- Log “Push button”
- Toggle LED
- Run “ToggleLed”
- Log “ToggleLed”
- Toggle LED
51. Node-RED is a tool for wiring together hardware
devices, APIs and online services in new and
interesting ways.
It’s all about using JavaScript on micro-controller boards or single-board computers
Agenda: baremetal javascript
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.