Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document SetWaveform #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions Protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ payload
float signal; // LE
int tx; // LE
int rx; // LE
short mcu_temperature;
short mcu_temperature; // LE; in hundredths of a degree Celsius
}
```

Expand Down Expand Up @@ -759,25 +759,46 @@ beyond that seems to be very blue.

### <a name="0x67"></a>0x67 - Set waveform

Sent to a bulb to configure its [waveform?]. [Advanced topic, needs expansion.]
Sent to a bulb to configure its "waveform"; i. e. a pattern of
alternation between two colors. One color is the original color, and
the other color is specified in this message.

#### Payload (21 bytes)

```c
payload {
byte stream;
byte stream; // Unusued; set to 0
byte transient;
uint16 hue; // LE
uint16 saturation; // LE
uint16 brightness; // LE
uint16 kelvin; // LE
uint32 period; // LE?
float cycles; // LE?
uint16 duty_cycles;
byte waveform;
uint32 period; // LE; length of one cycle in milliseconds
float cycles; // LE; number of times to cycle through pattern before stopping
int16 duty_cycle; // LE
WAVEFORM waveform;
}

enum WAVEFORM : byte
{
SAW = 0,
SINE = 1,
HALF_SINE = 2,
TRIANGLE = 3,
PULSE = 4
}
```

If _transient_ is 1, the color returns to the original color of the
light, after the specified number of _cycles_. If _transient_ is
0, the light is left set to _color_ after the specified number of
_cycles_.

If _duty_cycle_ is 0, an equal amount of time is spent on the original
color and the new _color_. If _duty_cycle_ is positive, more time is
spent on the original color. If _duty_cycle_ is negative, more time
is spent on the new color.

### <a name="0x68"></a>0x68 - Set dim (absolute)

Sent to a bulb to set its dim level.
Expand Down