So I'm trying to get X value from the analog gyro Sparkfun Gyro Breakout 
LPY503AL
https://www.sparkfun.com/products/11341

I'm trying to port this from http://www.pieter-jan.com/node/7

So here's what I'm trying to do, just have an angle change when it rotates 
on Z axis. That's all I want, just to know then it's moved and which way. 
My noobness is so bad in this area. Any help would be much appreciated! I'm 
guessing I'm going about this all wrong!


my code

var b = require('bonescript');

var gyroValue = 0; 
var offset = .70;
var angle = parseFloat('0');
var gyroRate = parseFloat('');

function callADC(){
    gyroValue = b.analogRead('P9_40');
    gyroRate = (gyroValue - offset) * 1.8; // Sensitivity has been found 
trial/error
    angle += gyroRate / 100.0;
    //console.log('Analog Read Value x: ' +angle); 
    console.log('gyroRate : ' +gyroRate); 
    console.log('gyroValue: ' +gyroValue); 
    console.log('gyroAngle: ' +angle); 
}

//callADC will be invoked 20 times a sec or once every 50 ms
var loop = setInterval(callADC, 50);    



I cannot figure out offsets or what the sensitivity should be. 

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to