This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
/**
|
||||
* @file commonFunctions.cpp
|
||||
* @author Lyubomir Penev (me@lpenev.com, 571147@student.fontys.nl)
|
||||
* @brief This file contains all the functions used to read buttons
|
||||
* @version 0.1
|
||||
* @date 2025-10-31
|
||||
*
|
||||
* @copyright Copyright (c) 2025
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <commonFunctions.h>
|
||||
#include <constants.h>
|
||||
|
||||
/**
|
||||
* @brief Function used to read state of a normally open(LOW) button
|
||||
*
|
||||
* @param buttonPin The pin of the button
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool Reader::debounceReadNO(int buttonPin)
|
||||
{
|
||||
bool reading = digitalRead(buttonPin);
|
||||
@@ -35,6 +53,13 @@ bool Reader::debounceReadNO(int buttonPin)
|
||||
return buttonPressed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function used to read state of a normally closed(HIGH) button
|
||||
*
|
||||
* @param buttonPin The pin of the button
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool Reader::debounceReadNC(int buttonPin)
|
||||
{
|
||||
bool reading = digitalRead(buttonPin);
|
||||
|
||||
Reference in New Issue
Block a user