This file contains 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
//Title: Button Debouncing using a State Machine, Complex Version | |
//Author: Chris Guichet | |
//Date: Jan 15, 2018 | |
// | |
//Description: | |
// -A State Machine is a useful tool to organize complex code | |
// -Think of it like the next step beyone "If Else" statements | |
// -This example code uses a State Machine to handle tac switch debouncing | |
// -It also has a "Hold" function to enable interaction with long button presses | |
// |
This file contains 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
//***VARIABLES AND SUCH*** | |
#include <Time.h> | |
#include <TimeLib.h> | |
#include <Adafruit_NeoPixel.h> | |
//Variables associated with Clock FSM | |
int t_hour = 20; | |
int t_minute = 29; | |
int t_second = 50; |
This file contains 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
//*************************************************************************************************** | |
//Defeinition of "Switch" class | |
//Should I change the name to avoid conflict with "switch" logical structure? | |
//*************************************************************************************************** | |
//The switch | |
class Switch | |
{ | |
public: |