mirror of
https://github.com/erik-toth/audio-synth.git
synced 2025-12-06 17:20:01 +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:
@@ -6,11 +6,22 @@ static byte pins_keyboard_col[N_KEYBOARD_COL] = {PIN_K_C0, PIN_K_C1, PIN_K_C2};
|
||||
|
||||
Keyboard keyboard(N_KEYBOARD_ROW, N_KEYBOARD_COL, pins_keyboard_row, pins_keyboard_col);
|
||||
|
||||
Adafruit_MCP4728 MCP4728;
|
||||
MCP4728_channel_t cvMap[N_CV_GATES] = {MCP4728_CHANNEL_A, MCP4728_CHANNEL_B};
|
||||
uint16_t keyToVoltage[N_KEYBOARD_ROW*N_KEYBOARD_COL] = {
|
||||
1*83, 5*83, 9*83,
|
||||
2*83, 6*83, 10*83,
|
||||
3*83, 7*83, 11*83,
|
||||
4*83, 8*83, 12*83
|
||||
};
|
||||
|
||||
CV cv(&MCP4728, &Wire, N_CV_GATES, cvMap, keyToVoltage, N_KEYBOARD_ROW, N_KEYBOARD_COL);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(BAUDRATE);
|
||||
//Wire.begin(PIN_SDA, PIN_SCL);
|
||||
keyboard.begin();
|
||||
cv.begin(PIN_SDA, PIN_SCL);
|
||||
}
|
||||
|
||||
void loop()
|
||||
@@ -22,13 +33,15 @@ void loop()
|
||||
if(n > 0)
|
||||
{
|
||||
Serial.printf("\n\rCurrent queue length: %i", n);
|
||||
for(int i = 0; i < n; i++)
|
||||
for(int i = 0; (i < N_CV_GATES) && (i < n); i++)
|
||||
{
|
||||
Key k = keyboard.getQueue(i);
|
||||
Key k = keyboard.getQueue(i);
|
||||
cv.setVoltage(i, k);
|
||||
if(isNotKey(k)) Serial.printf("\n\rQueue position %i: NOT A KEY", i);
|
||||
else Serial.printf("\n\rQueue position %i: R%iC%i", i, k.row, k.col);
|
||||
}
|
||||
}
|
||||
else cv.clearAll();
|
||||
|
||||
delay(50);
|
||||
}
|
||||
Reference in New Issue
Block a user