Added comments to potControlls
All checks were successful
Generate Documentation / build (push) Successful in 17s
All checks were successful
Generate Documentation / build (push) Successful in 17s
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @brief This function moves the potentiometer wiper one step to pin A
|
||||
*
|
||||
*/
|
||||
void potIncrement();
|
||||
|
||||
/**
|
||||
* @brief This function moves the potentiometer wiper one step to pin B
|
||||
*
|
||||
*/
|
||||
void potDecrement();
|
||||
@@ -27,11 +27,13 @@ void setup()
|
||||
pinMode(REMOTE_C, INPUT); // Remote Button C
|
||||
pinMode(REMOTE_D, INPUT); // Remote Button D
|
||||
|
||||
// Potentiometer
|
||||
pinMode(POT_CS, OUTPUT); // D10 - CS
|
||||
pinMode(POT_UD, OUTPUT); // D9 - U/D
|
||||
digitalWrite(POT_CS, HIGH);
|
||||
digitalWrite(POT_UD, LOW);
|
||||
|
||||
// Reset the potentiometer
|
||||
for (int i = 0; i < 64; i++)
|
||||
{
|
||||
potIncrement();
|
||||
@@ -74,6 +76,7 @@ void loop()
|
||||
}
|
||||
|
||||
// Remote C - Volume Down
|
||||
// Make sure we are not is a state of mute or lowered
|
||||
if (reader.debounceReadNO(REMOTE_C) && !(oldUserVolume > userVolume))
|
||||
{
|
||||
volumeDown(&userVolume, &oldUserVolume);
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
/**
|
||||
* @file potControlls.cpp
|
||||
* @author Lyubomir Penev (me@lpenev.com)
|
||||
* @brief Here are all the functions responsible for incrementing and decrementing the potentiometer
|
||||
* @version 0.1
|
||||
* @date 2025-10-31
|
||||
*
|
||||
* @copyright Copyright (c) 2025
|
||||
*
|
||||
* Here are all the functions responsible for incrementing and decrementing the MCP4011 digital potentiometer. For more information on the protocol used to control the potentiometer you can look on pages 29 and 31 of the datasheet, and for timing information you can checkout pages 6 and 7.
|
||||
*
|
||||
* Datasheet: https://ww1.microchip.com/downloads/en/devicedoc/21978a.pdf
|
||||
*
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <constants.h>
|
||||
#include <potControlls.h>
|
||||
|
||||
/**
|
||||
* @brief This function moves the potentiometer wiper one step to pin A
|
||||
*
|
||||
*/
|
||||
void potIncrement()
|
||||
{
|
||||
digitalWrite(POT_UD, HIGH);
|
||||
@@ -18,6 +37,10 @@ void potIncrement()
|
||||
digitalWrite(POT_CS, HIGH);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function moves the potentiometer wiper one step to pin B
|
||||
*
|
||||
*/
|
||||
void potDecrement()
|
||||
{
|
||||
digitalWrite(POT_UD, LOW);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file staffFunctions.cpp
|
||||
* @author Lyubomir Penev
|
||||
* @author Lyubomir Penev (me@lpenev.com)
|
||||
* @brief Here are all the implementations of the staff functions
|
||||
* @version 1.0
|
||||
* @date 2025-10-23
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file userFunctions.cpp
|
||||
* @author Lyubomir Penev
|
||||
* @author Lyubomir Penev (me@lpenev.com)
|
||||
* @brief Here are all the implementations for the user functions.
|
||||
* @version 1.0
|
||||
* @date 2025-10-23
|
||||
|
||||
Reference in New Issue
Block a user