firmwareSandsara
CallbacksToUpdate Class Reference

[BLE Command] This function is called when you write the UpdatePalette characteristic More...

Inheritance diagram for CallbacksToUpdate:
Collaboration diagram for CallbacksToUpdate:

Detailed Description

[BLE Command] This function is called when you write the UpdatePalette characteristic

You can define a custom palette to be shown in the led strip and you only need to send the “main colors” of the palette ( as low as 2 and up to 16) which Sandsara internally interpolates to a 256 color gradient.

Properties:

  • Write

UUID: 1a9a87b8-2305-11eb-adc1-0242ac120002

Usage: To define the custom palette, your need the next information: Amount of Colors, Positions, Red, Green, and Blue. only write to this characteristic the number of colors, positions, reds, greens, and blues values. Every value must be a Byte.

Range:

  • amount of colors: goes from 2 to 16.
  • positions: every position goes from 0 to 255.
  • reds: every red value goes from 0 to 255.
  • greens: every green value goes from 0 to 255.
  • blues: every blue value goes from 0 to 255.

In this image you can see more clearly how to send a palette.

updatePaletteExample.png

posible reponses:

  • "ok" the custom palette was updated successfully.
  • "error= -1" there is no data to update.
  • "error= -2 the number of colors is out of range"
  • "error= -3 the data is incompleted"

if you want to know what is the current palette you need to read the next characteristics

  • amount of colors characteristic (UUID: 1a9a820e-2305-11eb-adc1-0242ac120002)
  • positions characteristic (UUID: 1a9a82d6-2305-11eb-adc1-0242ac120002)
  • red characteristic (UUID: 1a9a83a8-2305-11eb-adc1-0242ac120002)
  • green characteristic (UUID: 1a9a8466-2305-11eb-adc1-0242ac120002)
  • blue characteristic (UUID: 1a9a852e-2305-11eb-adc1-0242ac120002)
    Note
    when you write to this characteristic you will be notified by the ledErrorMsg characteristic with the response.
    See also
    How to read the response of a characteristic

The documentation for this class was generated from the following file: