Skip to content
EN

command vs sine

This Arduino library (level-1) gives you two ways to make haptics. Neither needs an audio file on the MCU.

hb.play("sample-kit.sine_100hz", 0.6f);
  • The waveform lives in the kit on the Hapbeat. The MCU sends a ~30-byte trigger.
  • Deploy the kit to the device first with Hapbeat Studio.
  • Event ids are <kit-name>.<file-name> and must exist in the deployed kit.
  • Good for: pre-authored haptics (impacts, clicks) played by a fixed id.
hb.playSine(160.0f, 0.7f, 400); // frequency, intensity, duration
  • The waveform is synthesized on the MCU in real time. No kit, no WAV, no Studio.
  • Frequency and intensity are live parameters you can vary with input.
  • Good for: the quickest check, sensor/UI-driven expression, no files to prepare.
commandsine
Kit on the Hapbeatrequired (deploy via Studio)not needed
Data on the MCUnone (trigger only)none (synthesized live)
Expressivenesswhatever you authored in the kitlive frequency & intensity
First stepneeds a deployed kitbuzzes as-is (recommended)

When in doubt, verify connectivity with sine first, then put your authored haptics on command.

Not included in this version (future work):

  • Stored-WAV / clip streaming
  • An EventMap (tuning layer)
  • ESP-NOW transport (router-free path)

For the synthesized sine API, see Synthesized sine streaming.