Skip to content

Instantly share code, notes, and snippets.

@vaishnavachath
Created July 24, 2018 23:41
Show Gist options
  • Save vaishnavachath/d06a98966448c983d6c9a1e7e321cdc3 to your computer and use it in GitHub Desktop.
Save vaishnavachath/d06a98966448c983d6c9a1e7e321cdc3 to your computer and use it in GitHub Desktop.
script to test RCBMP,RCIMU and RCServo
var b = require('bonescript');
//test RC BMP
b.rcBMP('ENABLE');
setInterval(function() {
console.log(b.rcBMP('READ'));
},100);
//test RC IMU
/*
b.rcIMU('ENABLE');
setInterval(function() {
console.log(b.rcIMU('READ'));
},100);
*/
//test RC Servo
/*
b.rcServo('ENABLE');
b.rcServo('POWER_RAIL_ENABLE');//Enable 6V power rail
var pulse = -0.5;
setInterval(function() {
b.rcServo(1,pulse); // write to channel 1
if(pulse == -0.5)
pulse = 0.5;
else
pulse = -0.5;
},500);
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment