src/busylight.cpp
// Switches status based on a status struct provided
Switches status based on a status struct provided
Switches status based on a status struct provided
void switchStatus(struct status status) {
  if (status.blink > 0) {
    bool bstate = false;
    for(int j=0; j<status.blink; j++) {
      if (bstate) {
        setRGBColor(status.r, status.g, status.b);
      } else {
        setRGBColor(0, 0, 0);
      }
      bstate = !bstate;
      delay(500);
    }
  } else {
    setRGBColor(status.r, status.g, status.b);
  }
  strcpy(current_state, status.name);
}
void switchStatus ( struct status status ) { if ( status . blink > 0 ) { bool bstate = false ; for ( int j = 0 ; j < status . blink ; j ++ ) { if ( bstate ) { setRGBColor ( status . r , status . g , status . b ) ; } else { setRGBColor ( 0 , 0 , 0 ) ; } bstate = ! bstate ; delay ( 500 ) ; } } else { setRGBColor ( status . r , status . g , status . b ) ; } strcpy ( current_state , status . name ) ; }
Switches status based on a status struct provided
Switches status based on a status struct provided