Merge branch 'main' of https://github.com/SpaceyKasey/trigor-mortse
This commit is contained in:
commit
dc7dc45820
1 changed files with 11 additions and 11 deletions
|
@ -34,7 +34,7 @@ bool E1Btn = false;
|
|||
bool E2Btn = false;
|
||||
bool ClockState = false;
|
||||
bool Beat = false;
|
||||
unsigned int Channel1Trig = 0, Channel2Trig = 0; Channel3Trig = 0;
|
||||
unsigned int Channel1Trig = 0, Channel2Trig = 0, Channel3Trig = 0;
|
||||
bool E1Prev, E2Prev, CDPrev, E1Click, E2Click, CDIn = false, Channel1State = false, Channel2State = false, Channel3State = false;
|
||||
unsigned int E1Bounce, E2Bounce, CDBounce = 0, BeatBounce = 0;
|
||||
unsigned long ClockPrev = 0, ClockInPrev = 0, LastBeat = 0;
|
||||
|
@ -58,8 +58,8 @@ void setup() {
|
|||
pinMode(ClockIn, INPUT);
|
||||
pinMode(ClockDetect, INPUT_PULLUP);
|
||||
pinMode(Channel1, OUTPUT);
|
||||
PinMode(Channel2, OUTPUT);
|
||||
PinMode(Channel3, OUTPUT);
|
||||
pinMode(Channel2, OUTPUT);
|
||||
pinMode(Channel3, OUTPUT);
|
||||
|
||||
E1Btn = digitalRead(Enc1Btn);
|
||||
E1Prev = E1Btn;
|
||||
|
@ -124,9 +124,9 @@ void loop() {
|
|||
ClockPrev = tmpClock;
|
||||
|
||||
if (abs(ClockInPrev - clkInTick) > 500){
|
||||
Clock == ((1.0/(clkInTick/1000000.0)) * 60.0)/(float)PpQN;
|
||||
Clock =((1.0/(clkInTick/1000000.0)) * 60.0)/(float)PpQN;
|
||||
String outputBPM = "New BPM: ";
|
||||
outputBPM.concat(newBPM);
|
||||
outputBPM.concat(Clock);
|
||||
Serial.println(outputBPM);
|
||||
outputBPM = "Clock Tick: ";
|
||||
outputBPM.concat(clkInTick);
|
||||
|
@ -175,18 +175,18 @@ void loop() {
|
|||
if (!BeatBounce){
|
||||
|
||||
//Insert Beat Output here!
|
||||
char outputChar = TestString[Channel1Index];
|
||||
if (outputChar == '\0'){
|
||||
char outputChar = TestText[Channel1Index];
|
||||
if (outputChar == '/0'){
|
||||
Channel1Index = 0;
|
||||
outputChar = TestString[Channel1Index];
|
||||
outputChar = TestText[Channel1Index];
|
||||
}
|
||||
byte morselength = MorseTable[((int)outputChar - 32)];
|
||||
byte morseLength = MorseTable[((int)outputChar - 32)];
|
||||
byte morsePattern = morseLength;
|
||||
bool trigger = (morsePattern >> MorseIndex) & 1;
|
||||
|
||||
if (MorseIndex == 0){
|
||||
Channel1Index++;
|
||||
outputChar = TestString[Channel1Index];
|
||||
outputChar = TestText[Channel1Index];
|
||||
MorseIndex = ((MorseTable[((int)outputChar - 32)]) >> 5) - 1;
|
||||
}
|
||||
|
||||
|
@ -227,4 +227,4 @@ SIGNAL(TIMER0_COMPA_vect)
|
|||
Channel1Trig = (Channel1Trig - 1) & 0b10000000;
|
||||
Channel2Trig = (Channel2Trig - 1) & 0b10000000;
|
||||
Channel3Trig = (Channel3Trig - 1) & 0b10000000;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue