You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
#pragma config(Sensor, S3, kosketus2, 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;
}
}
}
You must log in to comment.