Versions Compared

Key

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

...

Info

See Gumband LED Status for a list of all status LED colors.

...

Tips for

...

Writing Gumband User Application Code

  • Gumband only checks for callbacks once at the end of every iteration of the loop() function. In general, it's a bad idea to use delays within this loop() function because it inhibits the system from checking callbacks constantly.

  • When reading data from a callback function, you need to cast the incoming data to get it in a usable form. This allows you to more easily use the data more than once if necessary. The type you cast it to should match the type of data of the peripheral.

    • Ex: Use

      Code Block
      languagearduino
      int32_t* dat = (int32_t*)data;

      for the gmbnd_int32 type

    • The Gumband API also includes type casting macros for each supported Gumband datatype. For example, to accomplish the same thing as above using only Gumband API features:

      Code Block
      languagearduino
      gmbnd_int32 dat = GUMBAND_INT32(data);
  • Peripheral/Property names can only be 15 characters, anything longer will be truncated.

  • The on-board LED and button work with digitalWrite() functions using the LED_BUILTIN and BUTTON_BUILTIN pin assignments. However, you can also use the custom gumbandLed() On/Off/Toggle/SetBrightness and gumbandButtonPressed() functions within the Gumband API.

  • The on-board button does not need to be initialized with pinMode(); it will work automatically. It will not work properly if reconfigured to INPUT_PULLUP or INPUT_PULLDOWN.

  • Initializing pins with pinMode() is not necessary for most I/O. They will be initialized automatically when calling digital/analog read/write. To configure pullup/pulldown resistors, pinMode() is necessary, however.

...