mirror of
https://github.com/erik-toth/audio-synth.git
synced 2025-12-06 11:20:02 +00:00
Software Upload 2
Firmware-Header ist fertig und kann nun zur Implementation zur DA verwendet werden. Anbei ist ein Beispiel der Verwendung!
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#define N_MAX_COLS 8
|
||||
#define MS_DEBOUNCE 20
|
||||
|
||||
#define N_MAX_DAC_CH 4
|
||||
|
||||
struct Key
|
||||
{
|
||||
int row;
|
||||
@@ -59,4 +61,26 @@ class Keyboard
|
||||
bool _isEqualKey(Key k1, Key k2);
|
||||
};
|
||||
|
||||
class CV
|
||||
{
|
||||
public:
|
||||
CV(Adafruit_MCP4728 *dac, TwoWire *wire, uint8_t nCV, MCP4728_channel_t *cvChannelMap, uint16_t *keyToVoltage, uint8_t row, uint8_t col);
|
||||
|
||||
bool begin(uint8_t pinSDA, uint8_t pinSCL);
|
||||
void setVoltage(uint8_t cvIndex, Key k);
|
||||
void setVoltage(uint8_t cvIndex, uint16_t mV);
|
||||
void clearAll();
|
||||
|
||||
private:
|
||||
Adafruit_MCP4728 *_dac;
|
||||
TwoWire *_wire;
|
||||
uint8_t _nCV;
|
||||
uint8_t _row;
|
||||
uint8_t _col;
|
||||
MCP4728_channel_t _cvChannelMap[N_MAX_DAC_CH];
|
||||
uint16_t *_keyToVoltage;
|
||||
uint8_t _getKeyToVoltageIndex(uint8_t row, uint8_t col);
|
||||
uint8_t _getKeyToVoltageIndex(Key k);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user