ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
APDS9960 Class Reference

A class for managing the Adafruit APDS9960 sensor. More...

#include <APDS9960.h>

Collaboration diagram for APDS9960:

Static Public Member Functions

static bool Initialize (uint8_t threshold)
 Initializes the APDS9960 sensor.
 
static bool isBooped ()
 Checks if the sensor is "booped" (close proximity detected).
 
static void ResetI2CBus ()
 Resets the I2C bus in case of communication issues.
 
static uint8_t GetValue ()
 Retrieves the current proximity value.
 
static uint16_t GetBrightness ()
 Retrieves the current brightness value.
 

Static Private Attributes

static Adafruit_APDS9960 apds
 Instance of the Adafruit APDS9960 sensor.
 
static uint16_t proximity
 Current proximity value.
 
static uint16_t threshold
 Threshold value for proximity detection.
 
static MinFilter< 10 > minF = MinFilter<10>(false)
 Minimum filter for smoothing proximity values.
 
static TimeStep timeStep = TimeStep(5)
 Time utility for managing timing intervals.
 
static float minimum = 0.0f
 Minimum detected value.
 
static bool didBegin = false
 Flag indicating if the sensor has been initialized.
 
static bool isBright = false
 Flag indicating if brightness detection is enabled.
 
static bool isProx = false
 Flag indicating if proximity detection is enabled.
 

Detailed Description

A class for managing the Adafruit APDS9960 sensor.

The APDS9960 class provides methods for initializing the sensor, detecting proximity and brightness, and determining if the sensor is close enough to trigger a "boop" detection.

Definition at line 27 of file APDS9960.h.

Member Function Documentation

◆ GetBrightness()

uint16_t GetBrightness ( )
static

Retrieves the current brightness value.

Returns
The current brightness value as a 16-bit integer.

Definition at line 78 of file APDS9960.cpp.

References apds, didBegin, and isBright.

Referenced by ClockAnimation::Update().

◆ GetValue()

uint8_t GetValue ( )
static

Retrieves the current proximity value.

Returns
The current proximity value as an 8-bit integer.

Definition at line 59 of file APDS9960.cpp.

References apds, didBegin, isProx, proximity, and ResetI2CBus().

Referenced by isBooped(), and GammaAnimation::Update().

◆ Initialize()

◆ isBooped()

◆ ResetI2CBus()

void ResetI2CBus ( )
static

Resets the I2C bus in case of communication issues.

Definition at line 53 of file APDS9960.cpp.

Referenced by GetValue().

Member Data Documentation

◆ apds

Adafruit_APDS9960 apds
staticprivate

Instance of the Adafruit APDS9960 sensor.

Definition at line 29 of file APDS9960.h.

Referenced by GetBrightness(), GetValue(), and Initialize().

◆ didBegin

bool didBegin = false
staticprivate

Flag indicating if the sensor has been initialized.

Definition at line 35 of file APDS9960.h.

Referenced by GetBrightness(), GetValue(), and Initialize().

◆ isBright

bool isBright = false
staticprivate

Flag indicating if brightness detection is enabled.

Definition at line 36 of file APDS9960.h.

Referenced by GetBrightness().

◆ isProx

bool isProx = false
staticprivate

Flag indicating if proximity detection is enabled.

Definition at line 37 of file APDS9960.h.

Referenced by GetValue().

◆ minF

MinFilter< 10 > minF = MinFilter<10>(false)
staticprivate

Minimum filter for smoothing proximity values.

Definition at line 32 of file APDS9960.h.

Referenced by isBooped().

◆ minimum

float minimum = 0.0f
staticprivate

Minimum detected value.

Definition at line 34 of file APDS9960.h.

Referenced by isBooped().

◆ proximity

uint16_t proximity
staticprivate

Current proximity value.

Definition at line 30 of file APDS9960.h.

Referenced by GetValue(), and isBooped().

◆ threshold

uint16_t threshold
staticprivate

Threshold value for proximity detection.

Definition at line 31 of file APDS9960.h.

Referenced by Initialize(), and isBooped().

◆ timeStep

TimeStep timeStep = TimeStep(5)
staticprivate

Time utility for managing timing intervals.

Definition at line 33 of file APDS9960.h.

Referenced by isBooped().


The documentation for this class was generated from the following files: