|
Smart Camera ESP32
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
|
High-level interface for 12-bit analog joystick input. More...
#include <joystick.h>
Public Member Functions | |
Initialization | |
| Joystick (uint8_t pin_x, uint8_t pin_y, uint8_t pin_z, int deadzone=JOYSTICK_DEADZONE) | |
| Construct a new Joystick object. | |
| void | begin () |
| Configures hardware and performs auto-calibration. | |
Positional Data | |
| int | get_x () const |
| int | get_y () const |
| bool | is_active () const |
| Checks if the joystick is currently deflected beyond the deadzone. | |
Button Input | |
| bool | is_z_pressed () |
| Detects a button press (Falling Edge). | |
| bool | is_z_held () const |
| Check the current physical state of the button. | |
Motor Control Mapping | |
| int | get_speed_x (int min_out=-255, int max_out=255) |
| Maps X deflection to a motor speed range. | |
| int | get_speed_y (int min_out=-255, int max_out=255) |
| Maps Y deflection to a motor speed range. | |
High-level interface for 12-bit analog joystick input.
Manages the translation of raw ADC voltage into meaningful movement vectors. Includes auto-calibration routines to compensate for mechanical center-point drift.
|
inline |
Construct a new Joystick object.
| pin_x | Analog Pin (VRX). |
| pin_y | Analog Pin (VRY). |
| pin_z | Digital Pin (SW). |
| deadzone | The sensitivity threshold (Defaults to JOYSTICK_DEADZONE). |
| void Joystick::begin | ( | ) |
Configures hardware and performs auto-calibration.
|
inline |
Maps X deflection to a motor speed range.
*
| min_out | Minimum speed (default -255). |
| max_out | Maximum speed (default 255). |
|
inline |
Maps Y deflection to a motor speed range.
*
| min_out | Minimum speed (default -255). |
| max_out | Maximum speed (default 255). |
|
inline |
|
inline |
| bool Joystick::is_active | ( | ) | const |
Checks if the joystick is currently deflected beyond the deadzone.
|
inline |
Check the current physical state of the button.
*
| bool Joystick::is_z_pressed | ( | ) |
Detects a button press (Falling Edge).
*