Simple test

Ensure your device works with this simple test.

examples/apds9500_simpletest.py
 1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
 2# SPDX-License-Identifier: MIT
 3
 4import time
 5import board
 6import busio
 7import adafruit_apds9500
 8from adafruit_apds9500 import Gesture
 9
10i2c = busio.I2C(board.SCL, board.SDA)
11
12apds = adafruit_apds9500.APDS9500(i2c)
13print("Gesture demo started!")
14while True:
15    gesture_reading = apds.gestures
16    if not gesture_reading:
17        continue
18    for gesture in gesture_reading:
19        print("\t", Gesture.string[gesture], "Gesture Detected")
20    print("")
21    time.sleep(0.1)