Embedded Linux
  • Cover
  • Summary
  • About This Training
    • Objectives
    • Skills
    • Prerequisites
    • Requirements
  • Once Upon A Time ...
  • Embedded Linux
  • Build Systems
    • Yocto Board Support Package
      • Yocto
      • Compilation
        • Make
        • Bitbake
        • Script
      • Building Blocks
      • SDK
      • Extra Packages
      • Kernel
        • Patch
        • Building
        • Headers
      • Modules
        • Cross Compilation
        • Native
      • Filesystem
      • Flashing
    • Distributions
      • CentOS
      • Google Brillo
      • Jubilinux
      • Kali
      • Ostro
      • Ubilinux
      • Debian
  • Boot Loaders
    • U-Boot
  • Initialization
    • Upgrade
    • Boot Up
    • Dual Boot
    • Root Directory
    • Display Message
    • Modules
    • Filesystem
    • Memory
    • Backup
    • Recovery
    • Reboot
    • Processes
  • User Space
    • Virtual Network Computing
    • Text Editors
    • Services
    • Logs
    • Package Management Systems
      • Open Package Management
      • Python Package Index
      • Nicely Package Make
      • Advanced Packaging Tool
      • Manual
      • Conda
    • Libraries
      • Mraa
      • Upm
      • OpenCv
      • Temboo
      • Libiio
    • Frameworks
      • Cylon JS
      • Johnny Five
      • ROS
      • Gobot
      • Pixhawk
      • Artoo
      • Bower
      • Zetta
      • Miscellaneous
  • Subsystems
    • X File Systems
    • Pin Muxing
    • Virtual File System
    • Memory
    • Input
    • General Purpose Input Output
    • Serial
    • Bluetooth
      • Advanced Audio Distribution Profile
        • Bluez
        • Gstreamer
        • Alsa
      • Human Interface Device Game Controller
      • Serial Port Protocol
      • Arduino
    • WiFi
    • Audio
    • Camera
    • Block
    • Universal Serial Bus
      • Human Interface Device Mini Keyboard
      • Python USB
    • Inter Integrated Circuit
    • Inter Process Communication
    • Peripheral Component Interconnect
    • Clock
    • Modems
    • Networking
    • Power
    • Thermal
    • Graphics
    • LED
    • LIDAR
    • Printer
    • Serial Peripheral Interface
  • Application Development
    • C
    • C++
    • Cross Compile
    • Containers
    • Python
    • NodeJS
    • Cloud9
    • Data
    • Drone Code
    • Speech
      • Python
    • Radio Frequency
    • Bots
    • Artificial Intelligence
      • WitAi
      • MycroftAi
    • Games
    • Vision
      • Bar Codes
      • Google Cloud Vision API
    • Messaging
    • Entertainment
    • Home Assistants
    • Dashboards
    • IRC
    • Location
    • Facial Recognition
    • Software Defined Radio
    • REST
    • Notes
    • Security
    • HAM Radio
    • Automotive
    • Digital Signage
    • Photography
  • Debug
  • Wrap-Up
    • Online Training
    • Challenge
    • Tbd
  • SandBox
Powered by GitBook
On this page
  • Cylon Intel IoT
  • Bluetooth Programming on the Intel Edison featuring Sphero
  • Grove Indoor Starter Kit
  • Cylon OpenCV
  1. User Space
  2. Frameworks

Cylon JS

PreviousFrameworksNextJohnny Five

Last updated 7 years ago

JavaScript framework for robotics, physical computing, and the Internet of Things (IoT)

JavaScript Robotics, By Your Command. Next generation robotics framework with support for 43 different platforms Get Started

Cylon Intel IoT

Cylon module for Intel-IoT platforms

This repository contains the Cylon adaptor for the Intel Edison and Intel Galileo IoT platforms. It uses the MRAA node module ()

    root@edison:~# npm install cylon cylon-intel-iot
    -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/cylon@1.2.0 node_modules/cylon

    cylon-intel-iot@0.8.1 node_modules/cylon-intel-iot
    ��├��─��─ cylon-gpio@0.27.0
    ��└��─��─ cylon-i2c@0.23.0
    root@edison:~# npm install cylon-gpio
    -\|/-\|/-\|/-\|/cylon-gpio@0.27.0 node_modules/cylon-gpio
    root@edison:~# npm install cylon-i2c
    -\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-cylon-i2c@0.24.0 node_modules/cylon-i2c
    root@edison:~# vi c.js
var Cylon = require('cylon');

Cylon.robot({
  connections: {
    edison: { adaptor: 'intel-iot' }
  },

  devices: {
    led: { driver: 'led', pin: 13 }
  },

  work: function(my) {
    every((1).second(), my.led.toggle);
  }
}).start();
    root@edison:~# node c.js 
    2016-03-27T18:24:03.339Z : [Robot 1] - Starting connections.
    2016-03-27T18:24:03.412Z : [Robot 1] - Starting connection 'edison'.
    2016-03-27T18:24:03.415Z : [Robot 1] - Starting devices.
    2016-03-27T18:24:03.416Z : [Robot 1] - Starting device 'led' on pin 13.
    2016-03-27T18:24:03.416Z : [Robot 1] - Working.
    ^Croot@edison:~#

Bluetooth Programming on the Intel Edison featuring Sphero

Grove Indoor Starter Kit

root@edison:~# npm install cylon cylon-intel-iot cylon-api-http cylon-gpio cylon-i2c
"use strict";

var cylon = require("cylon");

cylon.api({
  host: "0.0.0.0",
  port: "3000",
  ssl: false
});

cylon.robot({
  name: "doorbot",
  connections: {
    edison: { adaptor: "intel-iot" }
  },
  devices: {
    // digital sensors
    button: { driver: "button",        pin: 2, connection: "edison" },
    led:    { driver: "led",           pin: 3, connection: "edison" },
    // i2c devices
    screen: { driver: "jhd1313m1", connection: "edison" }
  },
  writeMessage: function(message, color) {
    var that = this;
    var str = message.toString();
    while (str.length < 16) {
      str = str + " ";
    }
    console.log(message);
    that.screen.setCursor(0,0);
    that.screen.write(str);
    switch(color)
    {
      case "red":
        that.screen.setColor(255, 0, 0);
        break;
      case "green":
        that.screen.setColor(0, 255, 0);
        break;
      case "blue":
        that.screen.setColor(0, 0, 255);
        break;
      default:
        that.screen.setColor(255, 255, 255);
        break;
    }
  },
  reset: function() {
    this.writeMessage("Doorbot ready");
    this.led.turnOff();
  },
  work: function() {
    var that = this;
    that.reset();

    that.button.on('push', function() {
      that.led.turnOn();
      that.writeMessage("Lights On", "blue");
    });

    that.button.on('release', function() {
      that.reset();
    });
  }
}).start();

Cylon OpenCV

    root@edison:~# npm install cylon cylon-opencv

Follow up instructions

Cylon.Js
Cylon.Js OpenCv
Cylon.Js Intel® Edison
https://github.com/intel-iot-devkit/mraa
NPM JS Intel IoT
here
Using Cylon.js With The Intel Edison and IoT Starter Kit