int potenciometer = A0;
int potValue = 0;
int buzzer = 8;
int hrz = 0;
int mappedPotValue = 0;
void setup() {
// put your setup code here, to run once:
pinMode(potenciometer, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
// Ziskavajte náhodnu hodnotu pre výšku tony
// potenciometrom ovládajte dĺžku tóny
hrz = random(31,4186);
potValue = analogRead(potenciometer);
mappedPotValue = map(potValue, 0, 1024, 0, 4186);
tone(8,hrz,mappedPotValue);
Serial.println(mappedPotValue);
delay(mappedPotValue);
}