Skip to content
APDS9930 Digital Proximity and Ambient Light Sensor package
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore first release. Apr 15, 2018
LICENSE first release. Apr 15, 2018
README.md first release. Apr 15, 2018
demo.jpg first release. Apr 15, 2018
demo1.jpg first release. Apr 15, 2018
demo2.jpg first release. Apr 15, 2018
icon.png make new icon.png Apr 15, 2018
main.ts use Math.idiv instead of / Jun 20, 2018
pxt.json use Math.idiv instead of / Jun 20, 2018
test1.ts first release. Apr 15, 2018
test2.ts first release. Apr 15, 2018

README.md

APDS9930

APDS9930 Digital Proximity and Ambient Light Sensor package

Author: shaoziyang
Date: 2018.Apr

Usage

open your microbit makecode project, in Add Package, paste

https://github.com/microbit-makecode-packages/APDS9930

to search box then search.

API

  • init()
    Initialize APDS9930, enable ALS and power.

  • getALS()
    get Ambient Light Sensor

  • getProximity()
    get Proximity data.

  • ALSEnable(en: boolean = true)
    Enable/Disable ALS feature.

  • ProximityEnable(en: boolean = true)
    Enable/Disable Proximity feature. Please note that VL must link to VCC when using proximity feature.

  • PowerOn()
    Set PON bit, enable all feature.

  • PowerOff()
    Clear PON bit, disable all feature.

  • AGAIN(gain: APDS9930_AGAIN)
    set ALS Gain.
    gain is:

    • AGAIN_1, 1
    • AGAIN_8, 8
    • AGAIN_16, 16
    • AGAIN_120, 120
  • PGAIN(gain: APDS9930_PGAIN)
    set Proximity Gain.
    gain is:

    • PGAIN_1, 1
    • PGAIN_2, 2
    • PGAIN_4, 4
    • PGAIN_8, 8

Demo

demo1

demo2

License

MIT

Copyright (c) 2018, microbit/micropython Chinese community

Supported targets

  • for PXT/microbit

[From microbit/micropython Chinese community](http://www.micropython.org.cn

You can’t perform that action at this time.