Software Update 3: Example 2 CV-Gates

This commit is contained in:
Erik Tóth
2025-11-02 17:27:22 +01:00
parent 3ad6aead6c
commit 5a578a74d8
3 changed files with 65 additions and 2 deletions

View File

@@ -1,3 +1,6 @@
/*
* Example Code Two
*/
#include "FIRMWARE_DEF.h"
#include "FIRMWARE.h"
@@ -33,10 +36,20 @@ void loop()
if(n > 0)
{
Serial.printf("\n\rCurrent queue length: %i", n);
if(n == 1)
{
cv.setVoltage(0, keyboard.getQueue(0));
cv.setVoltage(1, NOT_A_KEY);
}
else if(n >= 2)
{
cv.setVoltage(0, keyboard.getQueue(0));
cv.setVoltage(1, keyboard.getQueue(1));
}
for(int i = 0; (i < N_CV_GATES) && (i < n); 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);
}