int x,speed,gbias=0,x,y,t=0,div=360; float gyrobias=0,gyroread=0,gyrodeg=0; const tSensors Gyro = S1; task main(){ SensorType[Gyro]=sensorLightActive; SensorMode[Gyro]=modeRaw; gyrobias=SensorRaw[Gyro]; PlaySound(soundBeepBeep); while(true){ eraseDisplay(); gyroread=SensorRaw[Gyro]-gyrobias; gyrodeg+=gyroread/div; for(t=0;t<=360;t+=180){ x = sinDegrees(t+gyrodeg) * 25; y = cosDegrees(t+gyrodeg) * 25; nxtDrawLine(49,32,x+49,y+32); nxtDrawLine(47,32,x+49,y+32); nxtDrawLine(51,32,x+49,y+32); nxtDrawLine(49,34,x+49,y+32); nxtDrawLine(49,30,x+49,y+32);} if(gyrodeg< -3){ motor[motorB]=100; motor[motorC]=-100;} else if(gyrodeg>3){ motor[motorB]=-100; motor[motorC]=100;} else{ motor[motorB]=0; motor[motorC]=0;} wait1Msec(1); } }