test

Dependencies:   mbed

main.cpp

Committer:
ryosuke
Date:
2013-06-21
Revision:
0:d1f69bf9cfa4

File content as of revision 0:d1f69bf9cfa4:

#include "ITG3200.h"
#include "mbed.h"

Timer t;
Serial pc(USBTX, USBRX);
ITG3200 gyro(p9, p10);

      
int main() {
    

    pc.printf("Now starting ITG-3200 test\n");
    //gyro1.setWhoAmI(0x6b);
    wait(0.01);
    pc.printf("ID is :0x%02x\n",gyro1.getWhoAmI());
    //Set highest bandwidth.
    gyro1.setLpBandwidth(LPFBW_42HZ);

    //Arbitrary wait for printf clarity.

    wait(0.1);
    t.start();
    while (1) {
      
        pc.printf("%i, %i, %i\n\r", gyro1.getGyroX(), gyro1.getGyroY(), gyro1.getGyroZ());

    }

}