Skip to content

Instantly share code, notes, and snippets.

@jeffwmiles
Created May 21, 2020 22:23
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 jeffwmiles/d9efe495d0474c87f80835c5ce387b37 to your computer and use it in GitHub Desktop.
Save jeffwmiles/d9efe495d0474c87f80835c5ce387b37 to your computer and use it in GitHub Desktop.
Particle Photon application for receiving Teams presence statuses
int red = D5;
int yellow = D4;
int green = D6;
void setup()
{
Particle.function("setStatus", setStatus);
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
for(int i = D5; i <= D7; i++)
{
digitalWrite(i, HIGH);
delay(250);
digitalWrite(i, LOW);
delay(250);
}
backtodefault();
}
void loop()
{
}
void backtodefault()
{
digitalWrite(red, LOW);
digitalWrite(yellow, LOW);
digitalWrite(green, LOW);
}
int setStatus(String status)
{
backtodefault();
if(status == "Busy" || status == "DoNotDisturb"){
digitalWrite(red, HIGH);
}else if(status == "Away" || status == "TemporarilyAway" || status == "FreeIdle"){
digitalWrite(yellow, HIGH);
}else if (status == "Free"){
digitalWrite(green, HIGH);
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment