Added function to reset potentiometer
All checks were successful
Generate Documentation / build (push) Successful in 15s

This commit is contained in:
2025-11-02 14:18:01 +01:00
parent 7d31db7fcb
commit 57a7528ba3
3 changed files with 22 additions and 7 deletions

View File

@@ -23,3 +23,9 @@ bool debounceReadNC(int buttonPin);
*
*/
void setPinModes();
/**
* @brief Resets the potentiometer by setting the wiper all the way to the A pin
*
*/
void resetPotentiometer();

View File

@@ -11,6 +11,7 @@
#include <Arduino.h>
#include <commonFunctions.h>
#include <potControlls.h>
#include <constants.h>
unsigned long lastDebounceTime = 0;
@@ -125,3 +126,16 @@ void setPinModes()
digitalWrite(POT_CS, HIGH);
digitalWrite(POT_UD, LOW);
}
/**
* @brief Resets the potentiometer by setting the wiper all the way to the A pin
*
*/
void resetPotentiometer()
{
// Reset the potentiometer
for (int i = 0; i < 64; i++)
{
potIncrement();
}
}

View File

@@ -13,12 +13,7 @@ int oldUserVolume = userVolume;
void setup()
{
setPinModes();
// Reset the potentiometer
for (int i = 0; i < 64; i++)
{
potIncrement();
}
resetPotentiometer();
}
void loop()