class Sound - sound sensor


from ezblock import Sound, ADC

pin = ADC("A0")
sound = Sound(pin)                         # create an Sound object from a pin
val = sound.read_raw()                     # read an analog value

average_val = sound.read_raw(time = 100)   # read an average analog value


class ezblock.Sound(pin) Create an Sound object associated with the given pin. This allows you to then read analog values on that pin.


  • read - Read the value on the analog pin and return it. The returned value will be between 0 and 4095.