Added function to reset potentiometer
All checks were successful
Generate Documentation / build (push) Successful in 15s
All checks were successful
Generate Documentation / build (push) Successful in 15s
This commit is contained in:
@@ -22,4 +22,10 @@ bool debounceReadNC(int buttonPin);
|
||||
* @brief Sets all the pins to their correct modes
|
||||
*
|
||||
*/
|
||||
void setPinModes();
|
||||
void setPinModes();
|
||||
|
||||
/**
|
||||
* @brief Resets the potentiometer by setting the wiper all the way to the A pin
|
||||
*
|
||||
*/
|
||||
void resetPotentiometer();
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <commonFunctions.h>
|
||||
#include <potControlls.h>
|
||||
#include <constants.h>
|
||||
|
||||
unsigned long lastDebounceTime = 0;
|
||||
@@ -124,4 +125,17 @@ void setPinModes()
|
||||
pinMode(POT_UD, OUTPUT); // D9 - U/D
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,7 @@ int oldUserVolume = userVolume;
|
||||
void setup()
|
||||
{
|
||||
setPinModes();
|
||||
|
||||
// Reset the potentiometer
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
potIncrement();
|
||||
}
|
||||
resetPotentiometer();
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
||||
Reference in New Issue
Block a user