![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
A class for managing the Adafruit APDS9960 sensor. More...
#include <APDS9960.h>
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. | |
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.
|
static |
Retrieves the current brightness value.
Definition at line 78 of file APDS9960.cpp.
References apds, didBegin, and isBright.
Referenced by ClockAnimation::Update().
|
static |
Retrieves the current proximity value.
Definition at line 59 of file APDS9960.cpp.
References apds, didBegin, isProx, proximity, and ResetI2CBus().
Referenced by isBooped(), and GammaAnimation::Update().
Initializes the APDS9960 sensor.
threshold | The threshold for proximity detection. |
Definition at line 14 of file APDS9960.cpp.
References apds, didBegin, and threshold.
Referenced by AphoriAnimation::AphoriAnimation(), BasilGardenAnimation::BasilGardenAnimation(), GalaxyAnimation::GalaxyAnimation(), HertzzAnimation::HertzzAnimation(), InfraredAnimation::InfraredAnimation(), BroookAnimation::Initialize(), Warzone2Animation::Initialize(), ClockAnimation::Initialize(), GammaAnimation::Initialize(), HUB75AnimationSplit::Initialize(), WS35AnimationSplit::Initialize(), ProtogenProject::Initialize(), SammyAnimation::SammyAnimation(), SergaliciousAnimation::SergaliciousAnimation(), TamamoAnimation::TamamoAnimation(), and XenraxAnimation::XenraxAnimation().
|
static |
Checks if the sensor is "booped" (close proximity detected).
Definition at line 43 of file APDS9960.cpp.
References MinFilter< memory >::Filter(), GetValue(), TimeStep::IsReady(), minF, minimum, proximity, threshold, and timeStep.
Referenced by AphoriAnimation::Update(), BasilGardenAnimation::Update(), BroookAnimation::Update(), GalaxyAnimation::Update(), HertzzAnimation::Update(), InfraredAnimation::Update(), SammyAnimation::Update(), SergaliciousAnimation::Update(), TamamoAnimation::Update(), Warzone2Animation::Update(), XenraxAnimation::Update(), HUB75AnimationSplit::Update(), WS35AnimationSplit::Update(), and ProtogenProject::UpdateFace().
|
static |
Resets the I2C bus in case of communication issues.
Definition at line 53 of file APDS9960.cpp.
Referenced by GetValue().
|
staticprivate |
Instance of the Adafruit APDS9960 sensor.
Definition at line 29 of file APDS9960.h.
Referenced by GetBrightness(), GetValue(), and Initialize().
Flag indicating if the sensor has been initialized.
Definition at line 35 of file APDS9960.h.
Referenced by GetBrightness(), GetValue(), and Initialize().
Flag indicating if brightness detection is enabled.
Definition at line 36 of file APDS9960.h.
Referenced by GetBrightness().
Flag indicating if proximity detection is enabled.
Definition at line 37 of file APDS9960.h.
Referenced by GetValue().
Minimum filter for smoothing proximity values.
Definition at line 32 of file APDS9960.h.
Referenced by isBooped().
|
staticprivate |
|
staticprivate |
Current proximity value.
Definition at line 30 of file APDS9960.h.
Referenced by GetValue(), and isBooped().
|
staticprivate |
Threshold value for proximity detection.
Definition at line 31 of file APDS9960.h.
Referenced by Initialize(), and isBooped().
Time utility for managing timing intervals.
Definition at line 33 of file APDS9960.h.
Referenced by isBooped().