#
UART interface
⭐ Pro
The UART interface allows you to start and stop tracks saved on the satellite as well as dynamically adjust their intensity from another microcontroller. Enable UART mode by selecting UART as Pin Mode in the External trigger configuration.
The UART parameters are the following:
- TX pin
- GPIO Pin 1
- RX pin
- GPIO Pin 2
- Baud rate
- 9600
- Data bits
- 8
- Parity
- None
- Stop bits
- 1
- Flow control
- None
#
Upload a project
Start by uploading any project to the Satellite:
#
Command syntax
We maintain an identical syntax for all supported APIs including TCP, Serial and UART.
#
Start a track
startTrack("trackName" amplitudeScale);
Replace the trackName
with the name of the track you want to playback. Optionally, you can pass a value to scale the intensity (amplitude) of the track to be played back, for example doubling the intensity.
//Play the track called 'Short Pulses':
startTrack("Short Pulses");
//Play the track 'Short Pulses' at twice the intensity:
startTrack("Short Pulses" 2);
#
Stop playback
stop();
With this command, you can terminate any currently active playback.
#
Scaling intensity
⭐ Pro
setAmplitudeScale(amplitudeScale);
This command allows you to vary the intensity (amplitude) of the satellite output during the playback. The default value is 1.0, so you can reduce the intensity from its standard value by passing a scale value smaller than.
// Decrease the intensity value
setAmplitudeScale(0.7);
// Incerasing the intensity value
setAmplitudeScale(1.3);
// Reset the intensity value
setAmplitudeScale(1.0);
You can not increase the amplitude beyond 100%. If you e.g. select 100% amplitude in a block within Hapticlabs studio and use setAmplitudeScale(2.0);
, the maximum amplitude will remain the same as with setAmplitudeScale(1.0);