Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Anchor
_

...

5pzw3tpyw5i7
_

...

5pzw3tpyw5i7
Basic Arduino Setup

Anchor
_vrsg3e55v55a
_vrsg3e55v55a
Setting the Hardware ID

  1. Create a global Gumband object . This (must be declared as a global object.Initialize )

  2. Create a hardware unit on the Gumband Infrastructureplatform

  3. Set the Hardware ID. This is a unique value generated and assigned in the Gumband UI for each registered Hardware device. It is required to link Hardware to a specific Exhibit.

...

Alternatively, Gumband can be initialized in OFFLINE MODE. In OFFLINE MODE, MQTT messages are sent over USB.

...

*Note: See id() API Reference for detailed API documentation.

...

Anchor
_mumfdj3t5fha
_mumfdj3t5fha
Setting the Username and Password

  1. Set the Gumband Master control server username Set the Gumband Master control server and password

Image Removed

*Note: See See username() and password() API Reference for detailed API documentation.

...

Anchor
_faxjur8pzla2
_faxjur8pzla2
Creating a Property (Publish)

...

  1. Create GumbandProperty objects for every Gumband property in the exhibit.

  2. Initialise each Gumband property. Publish properties are initiated using a property name, a peripheral name and a property type.

...

*Note: See GumbandProperty API Reference for detailed API documentation.

...

Anchor
_ckmpf06ql7gf
_ckmpf06ql7gf
Creating a Peripheral (Subscribe)

...

  1. Create Gumband properties to which we subscribe to receive data.

  2. Subscribe properties are created using a property name, a peripheral name and a property type.

*Note: See API Reference for detailed API documentation

Anchor
_5pzw3tpyw5i7
_5pzw3tpyw5i7
Handling Data

...

  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.

...

*Note: See publish() API Reference for detailed API documentation.

...

Anchor
_zi62pp9t6ij3
_zi62pp9t6ij3
Publishing Event and Debug Data

Publish an event message to the Gumband event log using event().

Publish a debug message to the Gumband debug log using debug().

...

*Note: See API Reference for detailed API documentation