0x39
AGAIN(gain=None)
get/set ALS Gain.
gain is: [1, 8, 16, 120]
PGAIN(gain=None)
get/set Proximity Gain.
gain is: [1, 2, 4, 8]
Power(on=True)
set power on/off
poweron()
goto normal mode
ALS_Enable(on=True)
Enable/Disable ALS feature
Wait_Enable(on=True)
Enable/Disable Wait Timer feature
Proximity_Enable(on=True)
Enable/Disable Proximity feature
VL pin must connect to 3.3V before enable Proximity feature.
getALS()
get Ambient Light (lux)
getProximity()
get Proximity value.
VL pin must connect to 3.3V before enable Proximity feature.
from microbit import *
import APDS9930
apds = APDS9930.APDS9930()
while True:
sleep(500)
apds.getALS()
From microbit/micropython Chinese community.
www.micropython.org.cn