from machine import Pin, ADC
import time
adc= ADC(34)
led= Pin(2,Pin.OUT)
last_val= None
while True:
val=adc.read()
if val!=last_val:
print(val)
last_val= val
time.sleep(1)
if val < 3000:
print("low Sound Detected")
else:
led.on()
print("More Sound Detected")