<commit_before>#include "ToggleSwitch.h"
#include "SerialLog.h"
#include "DigitalActuator.h"
#include "TimedButton.h"

/*******************************
 * TimedButton - test and example
 *******************************/

Tinker::SerialLog 		serialLog;
typedef Tinker::SequentialStatusSwitcher<TimedButton>	StatusSwitcher;

StatusSwitcher::status_type currentStatus = 0;
StatusSwitcher statusSwitcher;

void setup(){
	Serial.begin(9600);
	serialLog.display("SequentialStatusSwitcher Example\n");
	
	button._log = &serialLog;
	//statusSwitcher.switch().setPin(2);
	//statusSwitcher.switch().initialize(1000,5000); //Setting a minimum of one sec and a maximum of five sec to activate
}

void loop(){
      const boolean activated(button.enabled());
      if(activated){
	  led.setEnabled(true);
          delay(100);
	  led.setEnabled(false);
      }
}<commit_msg>sequentialStatusSwitcher right implementation<commit_after>#include "ToggleSwitch.h"
#include "SerialLog.h"
#include "SequentialStatusSwitcher.h"
#include "TimedButton.h"

/*******************************
 * TimedButton - test and example
 *******************************/

Tinker::SerialLog 		serialLog;
typedef Tinker::SequentialStatusSwitcher<Tinker::TimedButton>	StatusSwitcher;

StatusSwitcher::status_type nStatus = 5;
StatusSwitcher::status_type currentStatus = 0;
StatusSwitcher statusSwitcher;

void setup(){
	Serial.begin(9600);
	serialLog.display("SequentialStatusSwitcher Example\n");
	
	statusSwitcher._log = &serialLog;
	statusSwitcher.switcher().setPin(2);
	statusSwitcher.switcher().initialize(1000,5000); //Setting a minimum of one sec and a maximum of five sec to activate
        statusSwitcher.setNumberOfStatus(nStatus);
        statusSwitcher.setStatus(currentStatus);
}

void loop(){
        statusSwitcher.refresh();
        StatusSwitcher::status_type s = statusSwitcher.status();
        if(s!=currentStatus){
          SECURE_LOG_VAL(statusSwitcher._log,"New status",s);
          currentStatus = s;
        }
}
{'fraction_non_alphanumeric': 0.17108554277138568, 'fraction_numerical': 0.016008004002001, 'mean_word_length': 5.309148264984227, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1888795', 'n_tokens_mistral': 625, 'n_tokens_neox': 611, 'n_words': 117}