...
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
...
Publish some arbitrary data (e.g. data from an encoder).
Obtain data. In this case we call a function where data from the encoder is decoded (line 89).
Call publish() with the peripheral and property names we created earlier, as well as the decoded data.
Publish a single byte of data (e.g. button state).
Obtain data. In this case we call a function that reads the button state (line 97).
Call publish() with the peripheral and property names we created earlier, as well as the button state data.
Publish an array of data (e.g. the last few encoder positions).
Obtain data. In this case, we call a function where data from the encoder is decoded and the last five encoder values are stored (line 109).
Call publish with the peripheral and property names we created earlier, as well as the decoded data and the length of the array where that data is stored.
See publish() API Reference for detailed documentation.
...