Added comments
All checks were successful
Generate Documentation / build (push) Successful in 21s

This commit is contained in:
2025-11-01 19:20:01 +01:00
parent 1837e09bc1
commit 0cc6f49130
4 changed files with 42 additions and 1 deletions

View File

@@ -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);