Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
_5pzw3tpyw5i7
_5pzw3tpyw5i7
Basic Arduino Setup

See https://docs.google.com/document/d/1K2cRBrJnSa8AWtDL8i6PVFxEyXkXKZmScGG4JmmmWCo/edit#heading=h.amhyvsfh7v9f.

Anchor
_vrsg3e55v55a
_vrsg3e55v55a
Setting the Hardware ID

...

  1. Publish some arbitrary data (e.g. data from an encoder).

    1. Obtain data. In this case we call a function where data from the encoder is decoded (line 89).

    2. Call publish() with the peripheral and property names we created earlier, as well as the decoded data.

  2. Publish a single byte of data (e.g. button state).

    1. Obtain data. In this case we call a function that reads the button state (line 97).

    2. Call publish() with the peripheral and property names we created earlier, as well as the button state data.

  3. Publish an array of data (e.g. the last few encoder positions).

    1. 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).

    2. 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.

...