development #4

Merged
elduko merged 6 commits from development into main 2025-10-31 15:22:25 +01:00
5 changed files with 37 additions and 2 deletions
Showing only changes of commit 40469c80c5 - Show all commits

View File

@@ -1,4 +1,13 @@
#pragma once #pragma once
/**
* @brief This function moves the potentiometer wiper one step to pin A
*
*/
void potIncrement(); void potIncrement();
/**
* @brief This function moves the potentiometer wiper one step to pin B
*
*/
void potDecrement(); void potDecrement();

View File

@@ -27,11 +27,13 @@ void setup()
pinMode(REMOTE_C, INPUT); // Remote Button C pinMode(REMOTE_C, INPUT); // Remote Button C
pinMode(REMOTE_D, INPUT); // Remote Button D pinMode(REMOTE_D, INPUT); // Remote Button D
// Potentiometer
pinMode(POT_CS, OUTPUT); // D10 - CS pinMode(POT_CS, OUTPUT); // D10 - CS
pinMode(POT_UD, OUTPUT); // D9 - U/D pinMode(POT_UD, OUTPUT); // D9 - U/D
digitalWrite(POT_CS, HIGH); digitalWrite(POT_CS, HIGH);
digitalWrite(POT_UD, LOW); digitalWrite(POT_UD, LOW);
// Reset the potentiometer
for (int i = 0; i < 64; i++) for (int i = 0; i < 64; i++)
{ {
potIncrement(); potIncrement();
@@ -74,6 +76,7 @@ void loop()
} }
// Remote C - Volume Down // Remote C - Volume Down
// Make sure we are not is a state of mute or lowered
if (reader.debounceReadNO(REMOTE_C) && !(oldUserVolume > userVolume)) if (reader.debounceReadNO(REMOTE_C) && !(oldUserVolume > userVolume))
{ {
volumeDown(&userVolume, &oldUserVolume); volumeDown(&userVolume, &oldUserVolume);

View File

@@ -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 <Arduino.h>
#include <constants.h> #include <constants.h>
#include <potControlls.h> #include <potControlls.h>
/**
* @brief This function moves the potentiometer wiper one step to pin A
*
*/
void potIncrement() void potIncrement()
{ {
digitalWrite(POT_UD, HIGH); digitalWrite(POT_UD, HIGH);
@@ -18,6 +37,10 @@ void potIncrement()
digitalWrite(POT_CS, HIGH); digitalWrite(POT_CS, HIGH);
} }
/**
* @brief This function moves the potentiometer wiper one step to pin B
*
*/
void potDecrement() void potDecrement()
{ {
digitalWrite(POT_UD, LOW); digitalWrite(POT_UD, LOW);

View File

@@ -1,6 +1,6 @@
/** /**
* @file staffFunctions.cpp * @file staffFunctions.cpp
* @author Lyubomir Penev * @author Lyubomir Penev (me@lpenev.com)
* @brief Here are all the implementations of the staff functions * @brief Here are all the implementations of the staff functions
* @version 1.0 * @version 1.0
* @date 2025-10-23 * @date 2025-10-23

View File

@@ -1,6 +1,6 @@
/** /**
* @file userFunctions.cpp * @file userFunctions.cpp
* @author Lyubomir Penev * @author Lyubomir Penev (me@lpenev.com)
* @brief Here are all the implementations for the user functions. * @brief Here are all the implementations for the user functions.
* @version 1.0 * @version 1.0
* @date 2025-10-23 * @date 2025-10-23