Cylon.js on Intel Edison
Team Cylon.js was at the Intel Developer Forum in San Francisco last week, and we got our hands on one of the new Intel Edison boards for the first time. We might have been a little skeptical after the hype of the initial Edison announcement at CES, but once we started working with it, within 24 hours we were very excited about the possibilities.
The Edison is a tiny System on Chip (SoC) board, that is intended to be the main processor for connected devices that include some intelligence inside. It includes dual-core Atom processors, 1GB of RAM, and built-in WiFi/Bluetooth LE, all on a single board with a tiny 70-pin Hirose "stacking connector".
The Hirose connector is one big clue to how Intel plans on the Edison being used: it is the base for a highly customized modular solution, that puts the Edison's GPIO, I2C, UARTs and other capabilities to work in a unique way. The Arduino-compatible breakout board for the Edison is just for compatibility sake. The much more interesting approach is that being used by Sparkfun, who are manufacturing a series of "blocks" which let you mix and match various individual capabilities.
Once you've prototyped everything, you would then manufacture a custom single board that uses only what you need for your embedded system. This is a very interesting way to approach modularity.
Thanks to the efforts of the Intel IoT team, there is a Linux image that includes everything you need for your code to access the various I/O capabilities of the various Intel boards. This is largely due to a compiled library called "MRAA", that is itself also open source.
We've just added support to Cylon.js for the Intel Edison, as well as updating our support for the Intel Galileo, so you can now use any of the GPIO and I2C devices that Cylon.js already includes, along with any of the many new devices that are being added all the time.
Here is a simple example, showing Cylon.js using the Intel Edison's GPIO for analog input using a potentiometer, and PWM output using an LED:
And here is the code:
var Cylon = require('cylon'); Cylon.robot({ connections: { edison: { adaptor: 'intel-iot' } }, devices: [ { name: 'sensor', driver: 'analogSensor', pin: 0 }, { name: 'led', driver: 'led', pin: 3 }, ], work: function(my) { my.sensor.on('analogRead', function(val) { brightness = val.fromScale(0, 1024).toScale(0, 255) | 0; console.log('brightness => ', brightness); my.led.brightness(brightness) }); } }).start();
We've also added full support for I2C devices. Here is the same example, but using a BlinkM connected via I2C:
Here is the code:
var Cylon = require('cylon'); Cylon.robot({ connections: { edison: { adaptor: 'intel-iot' } }, devices: [ { name: 'sensor', driver: 'analogSensor', pin: 0 }, { name: 'blinkm', driver: 'blinkm' }, ], work: function(my) { my.blinkm.stopScript(); my.sensor.on('analogRead', function(val) { brightness = val.fromScale(0, 1024).toScale(0, 255) | 0; console.log('brightness => ', brightness); my.blinkm.goToRGB(brightness, brightness, brightness); }); } }).start();
We've provided instructions on how to get started with Cylon.js and the Intel Edison on our documentation page here. We've also updated the documentation for our Intel Galileo at here.
We're really excited about the Intel Edison, and we will be adding more support for hardware based on this new platform as it comes out.
Keep up with our ongoing adventures on Twitter at @cylonjs.
Posts
- Cylon.js Off And Rolling In 2016
- Cylon.js 1.2.0 - Logging and Timing and BLE! Oh my!
- Cylon.js 1.1.0 - The Big Cleanup
- Hello, Node Bebop Drone
- Cylon.js featured in Wired
- Cylon.js 1.0.0 is here!
- Using Socket.io With The Cylon.js API
- Cylon 0.22.0 - A New Year's Release
- Cylon 0.21.0 is out!
- Creating Multiplatform Precompiled Binaries for Node.js Modules
- Cylon 0.20.0 is out!
- Running Robots From Your Browser With Cylon.js
- Winning the Dreamforce 500 With Cylon.js
- With The New Cylon.js 0.19.0, You Can Be Fluent Too
- Cylon.js on Intel Edison
- Cylon Takes Off on NodeBots Day
- Cylon.js Fun With The Arduino Yun
- Control Robots From Your Pebble
- Making Moves With Intel Galileo
- The Cylon Nest
- Announcing Full Tessel Support!
- Cylon 0.15.0 is Out!
- Cylon.js in Make Magazine!
- Cylon.js At JSConf 2014
- Cylon.js Takes The Stage At MakerFaire
- Cylon.js In Scotland
- Robots Are The New Normal At NextBerlin
- Thingscon - Ich Bin Ein Cylon
- National Robotics Week at the Robotics Society of Southern California
- Functional Robots With Wisp
- Release 0.12 Is For RobotOps
- Making Waves At Makerland
- This One Goes To 0.11 Of Pure JavaScript
- Tipping SCaLE12X
- Intro Robeaux- A Universal User Interface To Robotic Devices
- ng-robots! A Fun Robot Hackathon At The First ng-conf
- Number 9! The Release In Which We Add A Web UX, More Platforms, and Tools
- Release 0.8.0 Makes 10 Platforms
- RobotsConf Was Remarkable
- Dreamforce Means Connected Devices Are A Thing
- Dreamforce Is Coming!
- Welcome, Cylon.js