diff --git a/Software/Gravity/Gravity.ino b/Software/Gravity/Gravity.ino index 6c07fea..8e32520 100644 --- a/Software/Gravity/Gravity.ino +++ b/Software/Gravity/Gravity.ino @@ -250,9 +250,9 @@ ISR (PCINT2_vect) { } uint8_t encoderStatus; -//uint32_t encoderCheckTime = 0; -//uint32_t encoderTimeBetweenPulses = 0; -//bool encoderDirectionOld; //0 = -, 1 = +, Old because current direction can be determined by encoderChange +uint32_t encoderCheckTime = 0; +uint32_t encoderTimeBetweenPulses = 0; +bool encoderDirectionOld; //0 = -, 1 = +, Old because current direction can be determined by encoderChange int8_t encoderChange = 0; //uint8_t encoderBurstCount = 0; @@ -290,9 +290,9 @@ void checkEncoderStatus() { } encoderStatus = newStatus; - //uint32_t currentTime = millis(); - //encoderTimeBetweenPulses = currentTime - encoderCheckTime; - //encoderCheckTime = currentTime; + uint32_t currentTime = millis(); + encoderTimeBetweenPulses = currentTime - encoderCheckTime; + encoderCheckTime = currentTime; } void sendMIDIClock() { @@ -403,6 +403,7 @@ void externalClock() { } if ((newExtPulseTime - lastExtPulseTime) > 750) { resetClocks(); + sendMIDIStart(); extResetCountdown = 0; extTriggerCount = 0; } diff --git a/Software/Gravity/Interactions.ino b/Software/Gravity/Interactions.ino index 424ec8f..58c7cb0 100644 --- a/Software/Gravity/Interactions.ino +++ b/Software/Gravity/Interactions.ino @@ -93,8 +93,8 @@ void checkInputs() { encoderChange = encoderChange * -1; } - /*if (((encoderChange > 0) != encoderDirectionOld) && encoderTimeBetweenPulses < 150) { //filter out encoder "jumps". Comented out - encoderChange = 0; //because it seems like sometimes it was preventing normal scroll + /*if (((encoderChange > 0) != encoderDirectionOld) && encoderTimeBetweenPulses < 60) { //filter out encoder "jumps". + encoderChange = 0; //Comented out because it seems like sometimes it was preventing normal scroll } //if it works ok without it delete encoderDirectionOld var altogether encoderDirectionOld = (encoderChange > 0);*/