examples/javascript/adis16448.js
function periodicActivity()
{   
    //Read & Scale Gyro/Accel Data
    var xgyro = imu.gyroScale(imu.regRead(0x04));
    var ygyro = imu.gyroScale(imu.regRead(0x06));
    var zgyro = imu.gyroScale(imu.regRead(0x08));
    var xaccl = imu.accelScale(imu.regRead(0x0A)); 
    var yaccl = imu.accelScale(imu.regRead(0x0C));
    var zaccl = imu.accelScale(imu.regRead(0x0E));
    
    //Display Scaled Data on the Console Log
    console.log('XGYRO: ' + xgyro);
    console.log('YGYRO: ' + ygyro);
    console.log('ZGYRO: ' + zgyro);
    console.log('XACCL: ' + xaccl);
    console.log('YACCL: ' + yaccl);
    console.log('ZACCL: ' + zaccl);
    console.log(' ');
    setTimeout(periodicActivity,200); //call the indicated function after 0.2 seconds (200 milliseconds)
}
function periodicActivity()
{   
    //Read & Scale Gyro/Accel Data
    var xgyro = imu.gyroScale(imu.regRead(0x04));
    var ygyro = imu.gyroScale(imu.regRead(0x06));
    var zgyro = imu.gyroScale(imu.regRead(0x08));
    var xaccl = imu.accelScale(imu.regRead(0x0A)); 
    var yaccl = imu.accelScale(imu.regRead(0x0C));
    var zaccl = imu.accelScale(imu.regRead(0x0E));
    
    //Display Scaled Data on the Console Log
    console.log('XGYRO: ' + xgyro);
    console.log('YGYRO: ' + ygyro);
    console.log('ZGYRO: ' + zgyro);
    console.log('XACCL: ' + xaccl);
    console.log('YACCL: ' + yaccl);
    console.log('ZACCL: ' + zaccl);
    console.log(' ');
    setTimeout(periodicActivity,200); //call the indicated function after 0.2 seconds (200 milliseconds)
}
function periodicActivity ( ) { //Read & Scale Gyro/Accel Data var xgyro = imu . gyroScale ( imu . regRead ( 0x04 ) ) ; var ygyro = imu . gyroScale ( imu . regRead ( 0x06 ) ) ; var zgyro = imu . gyroScale ( imu . regRead ( 0x08 ) ) ; var xaccl = imu . accelScale ( imu . regRead ( 0x0A ) ) ; var yaccl = imu . accelScale ( imu . regRead ( 0x0C ) ) ; var zaccl = imu . accelScale ( imu . regRead ( 0x0E ) ) ; //Display Scaled Data on the Console Log console . log ( 'XGYRO: ' + xgyro ) ; console . log ( 'YGYRO: ' + ygyro ) ; console . log ( 'ZGYRO: ' + zgyro ) ; console . log ( 'XACCL: ' + xaccl ) ; console . log ( 'YACCL: ' + yaccl ) ; console . log ( 'ZACCL: ' + zaccl ) ; console . log ( ' ' ) ; setTimeout ( periodicActivity , 200 ) ; //call the indicated function after 0.2 seconds (200 milliseconds) }
Call the periodicActivity function
Call the periodicActivity function