-
Notifications
You must be signed in to change notification settings - Fork 0
MiP_Clap
MiP_Clap manages MiP's clap detection system, from enabling to disabling, configuring, and reporting on detected clap events.
Signature: constexpr uint8_t MIP_CMD_ENABLE_CLAP
Summary: The MiP protocol command to enable MiP's clap detection system.
Signature: constexpr uint8_t MIP_CMD_CLAP_RESPONSE
Summary: The MiP protocol response reporting the number of claps detected.
Signature: constexpr uint8_t MIP_CMD_SET_CLAP_DELAY
Summary: The MiP protocol command to set the minimum delay time between claps.
Signature: constexpr uint8_t MIP_CMD_GET_CLAP_SETTINGS
Summary: The MiP protocol command to read MiP's clap detection settings.
Signature: MiP_Clap(MiP &mip)
Summary: Constructs the clap system manager.
Parameters:
| Parameter | Description |
|---|---|
mip |
A reference to the main MiP object to access core services. |
Signature: void enableEvents()
Summary: Enables MiP's clap event reporting. This verified method sends the enable command and reads back settings to confirm success. It retries on failure.
Signature: void disableEvents()
Summary: Disables clap event reporting from MiP. This verified method sends the disable command and reads back settings to confirm success. It retries on failure.
Signature: bool areEventsEnabled()
Summary: Checks if clap event reporting is currently enabled.
Returns: true if enabled, false otherwise.
Signature: uint8_t availableEvents()
Summary: Returns the number of unread clap events in the queue. Processes any pending serial data first to update the queue.
Returns: Number of available clap events.
Signature: uint8_t readEvent()
Summary: Reads the next available clap event from the queue. Processes pending serial data first. If no event is available, sets last error to MIP_ERROR_NO_EVENT.
Returns: The clap event code, or 0 if none available.
Signature: uint16_t readDelay()
Summary: Reads the current clap delay setting.
Returns: The delay in milliseconds between clap events. Returns 0 on error.
Signature: void writeDelay(uint16_t delay)
Summary: Sets the minimum delay between clap events. Verified method: sends the new delay and confirms by reading back the settings. Retries automatically on mismatch or error.
Parameters:
| Parameter | Description |
|---|---|
delay |
Delay in milliseconds between allowed clap reports. |
- MiP
- MiPChestLED
- MiPClapSettings
- MiPDebug
- MiPHardwareInfo
- MiPHeadLEDs
- MiPIRDongleCode
- MiPSoftwareVersion
- MiPStatus
- MiP_Battery
- MiP_ChestLED
- MiP_Clap
- MiP_EEPROM
- MiP_Gesture
- MiP_HeadLEDs
- MiP_Infrared
- MiP_Mode
- MiP_Motion
- MiP_Odometer
- MiP_Position
- MiP_Radar
- MiP_Serial
- MiP_Shake
- MiP_Sound
- MiP_Version
- MiP_Weight
- MiP_WiFi