Fix volume adjustment

This commit is contained in:
Neale Pickett 2020-11-26 19:30:19 -07:00
parent 9745b18316
commit 34485f5a57
2 changed files with 3 additions and 4 deletions

View File

@ -4,8 +4,6 @@
#define ADJ_TYPEMATIC_DELAY 500
#define ADJ_TYPEMATIC_REPEAT 33
#define VOLUME_INITIAL 0.8
const char *settingNames[4] = {"c", "r", "d", "*"};
// quellUntil can be set to give the user time to get their fingers off the continuous adjustment buttons.
@ -38,7 +36,7 @@ void setupVolume() {
case ADJUST_DOWN:
{
float vol = volume[i] + float(volAdjust)*0.02;
volume[i] = min(max(vol, 1.0), 0.0);
volume[i] = max(min(vol, 1.0), 0.0);
}
break;
default:

View File

@ -22,8 +22,9 @@ Tuning tuning = Tuning(NOTE_D4, PITCH_CONCERT_D4, TUNINGSYSTEM_JUST);
Adafruit_SSD1306 display(128, 32, &Wire, -1);
// Settings
#define VOLUME_INITIAL 0.8
uint8_t patch[4] = {0};
float volume[5] = {0.8, 0.8, 0.8, 0.8, 0.5};
float volume[5] = {VOLUME_INITIAL, VOLUME_INITIAL, VOLUME_INITIAL, VOLUME_INITIAL, 0.5};
// Pipes
#define NUM_DRONES 3