void setup()
{
for (int port=0;port<=7;port ++)
{
pinMode(port, OUTPUT);
}
pinMode(A0, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
for (int port=0;port<=7;port ++)
{
digitalWrite(port, HIGH);
int rychlost=analogRead(A0);
rychlost = map(rychlost,0,1023,100,1000);
delay(rychlost);
digitalWrite(port, LOW);
}
for (int port=7;port>0;port --)
{
digitalWrite(port, HIGH);
int rychlost=analogRead(A0);
rychlost = map(rychlost,0,1023,100,1000);
delay(rychlost);
digitalWrite(port, LOW);
}
}