Skip to content

The gator:microphone is an I2C based audio sensor that is capable of reading both gate (whether the sound is above a threshold) or envelope (the volume of the sound)

License

Notifications You must be signed in to change notification settings

sparkfun/pxt-gator-microphone

Repository files navigation

gator:microphone sound Sensor

Community Discord

The gator:microphone, which includes a microphone along with an analog-to-I2C converter can be purchased here. The gator:microphone can be used to look at the envelope, or volume of sound, along with a simple gate value, which will tell whether a sound is detected above a certain threshold.

SparkFun gator:microphone

~ hint

To use this package, go to https://makecode.microbit.org, click Add package and search for gator-microphone. The package is located here

~

Basic usage

//Reads the volume of sound
gatorMicrophone.readEnvelopeData()

Use ||Get sound intensity|| to get the value from the envelope channel.

//Reads whether or not sound is above a certain level
gatorMicrophone.readGateData()

Use ||Check for sound|| to return a boolean for whether or not the sound is above a certain level

Example: Red Detector

//Read volume value and write it to the micro:bit screen as a bar graph.
basic.forever(function () {
    led.plotBarGraph(
    gatorMicrophone.readEnvelopeData(),
    2047
    )
})

Supported targets

  • for PXT/microbit

License

MIT

gatorMicrophone=github:sparkfun/pxt-gator-microphone

About

The gator:microphone is an I2C based audio sensor that is capable of reading both gate (whether the sound is above a threshold) or envelope (the volume of the sound)

Resources

License

Stars

Watchers

Forks

Packages