-
Created by Unknown User (jarisav), last modified on 1.12.2011
You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 4
Next »
#pragma config(Sensor, S3, kosketus1, sensorTouch)
task main()
{
int kosketus2Value=0;
int flipflop=0;
int apu=0;
while(true)
{
kosketus2Value = SensorValue(kosketus1);
if(kosketus2Value==1&&apu==0)
{
flipflop=1;
apu=1;
}
if(kosketus2Value==0&&flipflop==1)
{
apu=2;
}
if(kosketus2Value==1&&apu==2)
{
flipflop=0;
apu=3;
}
if(kosketus2Value==0&&apu==3)
{
apu=0;
}
if(flipflop==1)
{
/*
tänne ajotoiminnot
*/
}
else
{
/*
tänne pysäytykset
*/
}
}
}
You must log in to comment.