Created
January 15, 2014 00:37
-
-
Save lewisd32/8428766 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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