0

Using this exact code for my nodeJS file on my Intel Edison referenced from http://cylonjs.com/documentation/drivers/maxbotix/

The only difference is in the line edison: { adaptor: 'intel-iot' }

var Cylon = require('cylon');
Cylon.robot({
  connections: {
    edison: { adaptor: 'intel-iot' }
  },

  devices: {
    maxbotix: { driver: 'maxbotix' }
  },

  work: function(my) {
    every((1).seconds(), function() {
      my.maxbotix.range(function(data) {
        console.log("range: " + data);
      });
    });
  }
}).start();

I've done a npm install so all my modules are installed and doublechecked my wiring to ensure my sensor is connected properly.

Whenever I run the app I get the error

Error: No pin specified for Maxbotix. Cannot proceed

Any arduino, nodejs or cyclonjs experts able to suggest what is missing or wrong?

Bachalo
  • 6,965
  • 27
  • 95
  • 189

1 Answers1

0

You need to specify the analog pin the maxbotix is connected to in the device definition, like this:

var Cylon = require('cylon');

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

 // should be one of the analog pins from 0 to  5
 // if using the arduino shield.
 devices: {
  maxbotix: { driver: 'maxbotix', pin: '1' }
 },

 work: function(my) {
  every((1).seconds(), function() {
   my.maxbotix.range(function(data) {
    console.log("range: " + data);
   });
  });
 }
}).start(); 
ESX
  • 71
  • 1
  • 2
  • thanks getting closer. I see Initializing connections. Initializing devices. Starting connections. Starting devices. Working...and then nothing. I should be seeing the console.log message... – Bachalo Feb 13 '15 at 20:54