ジャイロセンサー1044 起動。
ジャイロセンサーを装着してみたが、なんの値を返しているか不明。
#define TIME 500
#define S1 0
int status = 0;
int kekka = 0;
int x = 0;
int y = 0;
int z = 0;
task kount(){
while(true){
status=Sensor(IN_4);
NumOut(60,LCD_LINE3,status);
NumOut(60,LCD_LINE4,x);
NumOut(60,LCD_LINE5,y);
NumOut(60,LCD_LINE6,z);
Wait(100);
}
}
task forward(){
while(true){
kekka = status % 2 ;
if(kekka==0){
Wait(100);
}
else{
Wait(100);
}
}
}
task main()
{
SetSensorLowspeed(S1);
SetSensorHTGyro(S4);
Wait(50);
Precedes(kount,forward);
}