#pragma config(Sensor, S1, MSANG, sensorI2CCustom)
#include "drivers/mindsensors-angle.h"
task main () {
nNxtButtonTask = -2;
nxtDisplayCenteredTextLine(0, "Mindsensors");
nxtDisplayCenteredBigTextLine(1, "Angle");
nxtDisplayCenteredTextLine(3, "Test 1");
nxtDisplayCenteredTextLine(5, "Connect sensor");
nxtDisplayCenteredTextLine(6, "to S1");
wait1Msec(2000);
eraseDisplay();
nxtDisplayCenteredTextLine(0, "GlideWheel-AS");
nxtDisplayTextLine(1, "-------------------");
nxtDisplayTextLine(5, "-------------------");
while (true) {
if (nNxtButtonPressed == kEnterButton)
{
MSANGresetAngle(MSANG);
while (nNxtButtonPressed != kNoButton) EndTimeSlice();
}
nxtDisplayTextLine(2, "Ang: %7d deg", MSANGreadAngle(MSANG));
nxtDisplayTextLine(3, "Raw: %7d", MSANGreadRaw(MSANG));
nxtDisplayTextLine(4, "RPM: %7d", MSANGreadRPM(MSANG));
nxtDisplayTextLine(7, " Reset angle");
wait1Msec(50);
}
}