Created
July 24, 2018 23:41
-
-
Save vaishnavachath/d06a98966448c983d6c9a1e7e321cdc3 to your computer and use it in GitHub Desktop.
script to test RCBMP,RCIMU and RCServo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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