Skip to content

Instantly share code, notes, and snippets.

@lewisd32
Created January 15, 2014 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewisd32/8428766 to your computer and use it in GitHub Desktop.
Save lewisd32/8428766 to your computer and use it in GitHub Desktop.
struct PeripheralCommand {
union {
struct {
uint8_t red;
uint8_t green;
uint8_t blue;
};
struct {
uint8_t hue;
uint8_t sat;
uint8_t bri;
};
};
};
PeripheralCommand cmd;
cmd.hue = 0;
Serial.println(cmd.hue);
cmd.red = 1;
Serial.println(cmd.hue);
Output:
0
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment