2. 可変 抵抗器 で 周波数 を 変 える スケッチ
//
#define DURATION 50
// スピーカーの ピンを デジタル 10
#define SPEAKER_PIN 10
//
#define RESISTOR_PIN A0
//
int sensorValue = 0;
void setup() {
//
}
void loop() {
//analogRead
sensorValue = analogRead(RESISTOR_PIN);
//sensorValueの
tone(SPEAKER_PIN, sensorValue, DURATION); delay(DURATION);
}