Stap 2: De Code
int oct [15] = {262, 294, 330, 349, 392, 440, 494, 523, 587, 659, 698, 784, 880, 988, 1047};
int Play = oct [0];
void setup (){ pinMode (5, OUTPUT); pinMode (A1, INPUT); Serial.begin (9600); }
void loop (){ int Hz = constrain (map (analogRead (A1), 100, 500,0, 14), 1, 14); Serial.println (Play); if (Play > oct [Hz]) {Play = Play - 6;} if (Play < oct [Hz]) {Play = Play+6;} tone (5,Play ); // delay (100); }