Skip to content

APDS9930 Digital Proximity and Ambient Light Sensor package

License

Notifications You must be signed in to change notification settings

makecode-extensions/APDS9930

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

APDS9930 Digital Proximity and Ambient Light Sensor package

Resources

License

Stars

Watchers

Forks

Packages

No packages published