Purpose:
Allows user-defined mathematical expressions to process incoming sensor data.
๐ง Syntax (in user defined code)
F14,<formula>,<A_pos>,<B_pos>,<C_pos>,<D_pos>
<formula>
: A math expression using placeholders (A
, B
, C
, D
, R
, X
, Y
, Z
)
<A_pos>
to <D_pos>
: Indexes referring to the values in the sensorString
, starting after the timestamp
๐ Placeholders
Placeholder | Description |
---|---|
A โD | Values from the sensorString |
R | Result from the previous F14 calculation |
X โZ | Internal counters (can be used or updated later) |
The result of each calculation is stored in R
, which can be used in subsequent formulas.
๐งช Example
Configuration line:
F14,A*1,2,0,0,0
Incoming sensor string:
2025/06/23 09:46:50,12453,0,22.3
After skipping the timestamp:
- Index 0 โ
12453
- Index 1 โ
0
- Index 2 โ
22.3
A = 22.3
Formula: A * 1
Result: R = 22.3
โ Notes
- Comma-separated
sensorString
values are indexed starting at 0 (after timestamp). - Only available in User-Defined Mode
- Avoid invalid math operations (e.g., division by zero).
- Useful for scaling, offsetting, combining, or converting raw values on-device.