Skip to content

Instantly share code, notes, and snippets.

@monkbroc
Created December 13, 2015 15:14
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 monkbroc/5a52eccfb4863fc04009 to your computer and use it in GitHub Desktop.
Save monkbroc/5a52eccfb4863fc04009 to your computer and use it in GitHub Desktop.
Beach safety
int setBeachStatus(String value) {
RGB.control(true);
if(value == "green") {
RGB.color(RGB_COLOR_GREEN);
return 0;
} else if(value == "yellow") {
RGB.color(RGB_COLOR_YELLOW);
return 0;
} else if(value == "red") {
RGB.color(RGB_COLOR_RED);
return 0;
}
return 1;
}
void setup() {
Particle.function("beach-status", setBeachStatus);
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment