NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
ex_digyro.nxc

This is an example of how to use the SetSensorDIGyro, SetSensorDIGyroEx, SensorDIGyroTemperature, SensorDIGyroStatus, ReadSensorDIGyroRaw, and ReadSensorDIGyro functions.

//#define RAW
#define DEFAULT
task main(){
#ifdef DEFAULT
#else
#endif
int i = 0;
int temp;
byte status;
bool done = false;
while (!done){
// Read the GYROSCOPE
#ifdef RAW
if (!ReadSensorDIGyroRaw(S1, val))
#else
if (!ReadSensorDIGyro(S1, val))
#endif
TextOut(0, LCD_LINE8, "fail");
NumOut(0, LCD_LINE1, val.X);
NumOut(0, LCD_LINE2, val.Y);
NumOut(0, LCD_LINE3, val.Z);
}
}