WITGyro

Dependencies:   Terminal mbed

main.cpp

Committer:
marcuss421
Date:
2013-11-11
Revision:
0:0d844f8ecb72

File content as of revision 0:0d844f8ecb72:

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

Terminal term(USBTX, USBRX);
ITG3200 gyro(p9, p10);

int main() 
    {
    wait(1);
    term.printf("Starting Gyro test... \n \r");
    gyro.setLpBandwidth(LPFBW_42HZ);
    int x = 0;
    int y = 0;
    int z = 0;
    while (1)
        {
        wait(0.2);
        x = gyro.getGyroX();
        y = gyro.getGyroY();
        z = gyro.getGyroZ(); 
        term.printf("X-%i   Y-%i   Z-%i \n \r", x,y,z);
        }
    }