Impplemenation of EN-Pins for CV-Gates, Metronome

This commit is contained in:
2025-12-06 11:48:11 +01:00
parent 06fa584b6d
commit 7c8a90ce7d
9 changed files with 201 additions and 94 deletions

View File

@@ -4,7 +4,7 @@
@contact: etoth@tsn.at
@date: 2025-10-26
@updated: 2025-12-06
@brief: Header for FIRMWARE.cpp (FIXED)
@brief: Header for FIRMWARE.cpp (FIXED VERSION)
*/
#include <Arduino.h>
#include <Wire.h>
@@ -30,6 +30,7 @@ struct DualVoltageDurationPair
uint16_t voltage_ch1;
uint16_t voltage_ch2;
uint16_t duration;
bool active; // NEU: true wenn Step aktive Noten hat, false für Pausen
};
const Key NOT_A_KEY = {-1, -1};
@@ -117,6 +118,7 @@ class SequencerBlock
uint16_t getStepCount();
uint16_t getCurrentVoltageCh1();
uint16_t getCurrentVoltageCh2();
bool isCurrentStepActive(); // NEU: Prüft ob aktueller Step aktive Noten hat
uint16_t getTotalDuration();
private:
@@ -124,7 +126,7 @@ class SequencerBlock
* @brief Memory limiting
* @return (uint16_t) 1024
* @attention Increasing the value might lead to an overflow
* @note sizeOf(DualVoltageDurationPair) = 6 Byte ==> 6 Byte * 1024 = 6144 Byte
* @note sizeOf(DualVoltageDurationPair) = 8 Byte ==> 8 Byte * 1024 = 8192 Byte
*/
const static uint16_t _MAX_SEQUENCE_STEPS = 1024;

View File

@@ -14,35 +14,36 @@
// CONSTANTS DEFINITONS
#define N_KEYBOARD_ROW 4 // for PROD. change to 5
#define N_KEYBOARD_COL 3 // for PROD. change to 5
#define N_CV_GATES 2
#define N_SB 2
#define N_CV_GATES 2 // PROD. OK
#define N_SB 2 // PROD. OK
#define BAUDRATE 115200
#define N_MAX_SEQ_STEPS 512
// PIN DEFENTITIONS
// I2C PINS
#define PIN_SDA 15
#define PIN_SCL 16
#define PIN_SDA 15 // PROD. pin OK
#define PIN_SCL 16 // PROD. pin OK
// KEYBOARD PINS
#define PIN_K_R0 7
#define PIN_K_R1 8
#define PIN_K_R2 9
#define PIN_K_R3 10
#define PIN_K_R4 11 // DEV. not in use
#define PIN_K_C0 1
#define PIN_K_C1 2
#define PIN_K_C2 4
#define PIN_K_C3 5 // DEV. not in use
#define PIN_K_C4 6 // DEV. not in use
#define PIN_K_R0 7 // PROD. pin OK
#define PIN_K_R1 8 // PROD. pin OK
#define PIN_K_R2 9 // PROD. pin OK
#define PIN_K_R3 10 // PROD. pin OK
#define PIN_K_R4 11 // DEV. not in use - PROD. pin OK
#define PIN_K_C0 1 // PROD. pin OK
#define PIN_K_C1 2 // PROD. pin OK
#define PIN_K_C2 4 // PROD. pin OK
#define PIN_K_C3 5 // DEV. not in use - PROD. pin OK
#define PIN_K_C4 6 // DEV. not in use - PROD. pin OK
// SEQUENCER BUTTON PINS
#define PIN_SB_1_REC 42 // for PROD. change to 33 / not available on dev board
#define PIN_SB_1_PLAY 41 // for PROD. change to 34 / not available on dev board
#define PIN_SB_2_REC 40 // 35
#define PIN_SB_2_PLAY 39 // 36
#define PIN_SB_1_REC 38 // for PROD. change to 33 / not available on dev board
#define PIN_SB_1_PLAY 37 // for PROD. change to 34 / not available on dev board
#define PIN_SB_2_REC 35 // 35
#define PIN_SB_2_PLAY 36 // 36
// MISC/INFO PINS
#define PIN_ACTIVE -1 // TODO: if any key is played return HIGH
#define PIN_REC -1 // TODO: if any sb is recording return HIGH
#define PIN_BPM -1 // TODO: get bpm through potentiometer analog value
#define PIN_B_METRONOME -1 // TODO: button activates/deactivates bpm led output
#define PIN_L_METRONOME -1 // TODO: led blinks according to bpm value
#define PIN_VCO1_EN 41 // PROD. pin 37 TODO: if there is an active key mapped to CV-Gate 1 --> HIGH
#define PIN_VCO2_EN 40 // PROD. pin 38 TODO: if there is an active key mapped to CV-Gate 2 --> HIGH
#define PIN_REC 39 // PROD. pin 39 TODO: if any sb is recording LED on (active-low)
#define PIN_BPM 12 // PROD. pin 12 TODO: get bpm through potentiometer analog value -> ADC-Pin
#define PIN_B_METRONOME 13 // PROD. pin 13 TODO: button activates/deactivates bpm led output (pull-up)
#define PIN_L_METRONOME 14 // PROD. pin 14 TODO: led blinks according to bpm value (active-low)
#endif