Kód: Vybrat vše
int x=0;
int y=0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
x=analogRead(A0);
if (x<101)
{
y=0;
goto tu;
}
if (x<201)
{
y=3;
goto tu;
}
if (x<301)
{
y=6;
goto tu;
}
if (x<601)
{
y=9;
goto tu;
}
if (x<801)
{
y=15;
goto tu;
}
if (x<901)
{
y=18;
goto tu;
}
if (x>900) y=20;
tu:
if (y>10)
{
Serial.println(y);
}
}