Gyro code help

So I’m trying to get X value from the analog gyro Sparkfun Gyro Breakout LPY503AL

I’m trying to port this from

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.