from machine import Pin, PWM _init() SpeakerPin = 15 Speaker = Pin(SpeakerPin, Pin.OUT) Sound = PWM(Speaker) Sound.duty(512) adc = machine.ADC(0) while True: value = adc.read() Sound.freq(value)