npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cylon-odroid

v1.1.0

Published

Cylon Adaptor for Odroid single-board computers

Downloads

11

Readme

Cylon.js For ODROID

Cylon.js (http://cylonjs.com) is a JavaScript framework for robotics, physical computing, and the Internet of Things (IoT) using Node.js.

This module provides an adaptor for ODROID Linux computers (http://www.hardkernel.com/main/main.php).

Supported Odroid Boards

  • Odroid XU4
  • Odroid XU3

More devices to be added shortly...

How to Install

Installing Cylon.js is easy, and must be done on an Odroid Board with NodeJS.

$ npm install cylon cylon-odroid cylon-gpio cylon-i2c

How to Use

var Cylon = require("cylon");
var odroid = require("cylon-odroid");

// Initialize the robot
Cylon.robot({
  connections: {
    odroid: { adaptor: "odroid" }
  },

  devices: {
    led: { driver: "led", pin: 27 },
    button: { driver: "button", pin:  26, type: "closed"}
  },

  work: function(my) {
    my.button.on('push', function() { my.led.toggle() });
  }
}).start();

How to Use The XU4 ShifterShield

var Cylon = require("cylon");
var odroid = require("cylon-odroid");

// Initialize the robot
Cylon.robot({
  connections: {
    odroid: { adaptor: "odroid", shifterShield: true }
    //You could also invert the ShifterShield pins such that pin 40 = pin 1, pin 39 = pin 2...
    //odroid: {   
    //    adaptor: "odroid", 
    //    shifterShield: {
    //            inverted: true
    //        } 
    //    }
  },

  devices: {
    led: { driver: "led", pin: 27 },
    button: { driver: "button", pin:  26 }
  },

  work: function(my) {
    my.button.on('push', function() { my.led.toggle() });
  }
}).start();

How to Use The XU4 12 Pin Header

var Cylon = require("cylon");
var odroid = require("cylon-odroid");

// Initialize the robot
Cylon.robot({
  connections: {
    odroid: { adaptor: "odroid" },
    con11: { adaptor: 'xu4-12pin' }
  },

  devices: {
    led: { driver: "led", pin: 27 },
    //Set the button to use pin 6 on the 12 pin header
    button: { driver: "button", pin:  6, connection: 'con11' }
  },

  work: function(my) {
    my.button.on('push', function() { my.led.toggle() });
  }
}).start();

How to Use Serial Communication

The Serial driver is a wrapper the node library : serialport. Use as if the driver is the package itself.

var Cylon = require("cylon");
var odroid = require("cylon-odroid");

// Initialize the robot
Cylon.robot({
  connections: {
    odroid: { adaptor: "odroid" }
  },

  devices: {
     serialDevice: { driver: 'serial' } //9600 BaudRate
  },

  work: function(my) {
    my.serialDevice.write('hello \n');
  }
}).start();

Options available

devices: {
 serialDevice: { driver: 'serial', baudRate: 57600, port: '/dev/ttyS0', parser: { byteLength : 5} }
},
//The default port used is the Odroid Boards pin serial port
//Parsers
//Other parsers avaialable
parser: { byteDelimiter: [10,12] }

Commands available are such as:

  • write
  • pause
  • resume
  • flush
  • close
  • update
  • set

Looking for a something like serial.available()? listen for the data event instead

my.serialDevice.on('data',function(data) {
  //Do something with the data passed
});

Other events available

  • open
  • close
  • error
  • disconnect

You can checkout the serialport repo here or here

License

Copyright (c) 2017 ODROIDJS. Licensed under the Apache 2.0 license.