...
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 thisloop()
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 language arduino int32_t* dat = (int32_t*)data;
for the
gmbnd_int32
typeThe 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 language arduino 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 theLED_BUILTIN
andBUTTON_BUILTIN
pin assignments. However, you can also use the customgumbandLed()
On/Off/Toggle/SetBrightness andgumbandButtonPressed()
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 toINPUT_PULLUP
orINPUT_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.
...