Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 5e56851

Browse files
committed
Fix letter/word break timing
1 parent fde3ba7 commit 5e56851

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: examples/FirebaseMorse_ESP8266/FirebaseMorse_ESP8266.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,17 @@ void loop() {
6969
// Wait while button is up.
7070
int upStarted = millis();
7171
while (digitalRead(morseButtonPin) == HIGH) {
72-
if (millis() - upStarted > longMillis) {
72+
if (millis() - upStarted > shortMillis*7) {
7373
updateDisplay(currentMessage, 'w', currentLetter);
74-
} else if (millis() - upStarted > shortMillis*3) {
74+
} else if (millis() - upStarted > longMillis) {
7575
updateDisplay(currentMessage, 'l', currentLetter);
7676
} else {
7777
updateDisplay(currentMessage, ' ', currentLetter);
7878
}
7979
delay(1);
8080
}
8181
int upTime = millis() - upStarted;
82-
if (upTime > shortMillis*3) {
82+
if (upTime > longMillis) {
8383
// A letter break is 3 * the length of a short (.).
8484
if (currentLetter > morseToCharSize || morseToChar[currentLetter] == '\0') {
8585
Serial.println("Invalid morse char, ignoring");

0 commit comments

Comments
 (0)