Lux/Sound Meter
Using the mPython Board’s onboard microphone and light sensor, you can make a sound meter or lux meter to detect the environment!
from mpython import *
u=UI(oled)
while True:
oled.fill(0)
lightValue=numberMap(light.read(),0,4093,0,100)
soundValue=numberMap(sound.read(),0,4093,0,100)
u.stripBar(35,8,10,40,soundValue,0)
u.stripBar(90,8,10,40,lightValue,0)
oled.DispChar("Sound",23,50)
oled.DispChar("Lux",76,50)
oled.show()