Maxbotix
This module provides tooling to use the Maxbotix Sonar range finder, a set of easy-to-use ultrasonic sensors that provide stable range readings.
For more information click here.
How To Connect
Cylon.robot({ connections: { arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' } }, devices: { maxbotix: { driver: 'maxbotix', pin: 1 } }, });
How To Use
var Cylon = require('cylon'); Cylon.robot({ connections: { arduino: { adaptor: 'firmata', port: '/dev/ttyACM0' } }, devices: { maxbotix: { driver: 'maxbotix', pin: 1 } }, work: function(my) { every((1).seconds(), function() { my.maxbotix.range(function(data) { console.log("range: " + data); }); }); } }).start();
Commands
range
Gets the distance measured by the sonar, in inches.
Params
-
[callback] (
Function
) invoked witherr, value
as args
Returns
- (
Number
) the current measured distance, in inches
rangeCm
Gets the distance measured by the sonar, in centimeters.
Params
-
[callback] (
Function
) invoked witherr, value
as args
Returns
- (
Number
) the current measured distance, in centimeters
Events
range
Emitted when the Maxbotix has detected the current range
Values
- distance the current distance in inches
rangeCm
Emitted when the Maxbotix has detected the current range
Values
- distance the current distance in centimeters