60ms for dit is 20 wpm according to https://morsecode.world/international/timing.html
This commit is contained in:
parent
1673016c5f
commit
a920e282e5
8
main.py
8
main.py
@ -17,7 +17,7 @@ zipleds = KitronikZIPLEDs(3)
|
|||||||
# Python u arse hole sec = Integer()
|
# Python u arse hole sec = Integer()
|
||||||
rtc.setDate(16, 7, 2022)
|
rtc.setDate(16, 7, 2022)
|
||||||
rtc.setTime(12, 10, 0)
|
rtc.setTime(12, 10, 0)
|
||||||
rate = 100
|
rate = 60 # 20 wpm
|
||||||
#bme688.setupGasSensor()
|
#bme688.setupGasSensor()
|
||||||
#bme688.calcBaselines()
|
#bme688.calcBaselines()
|
||||||
sec = 0
|
sec = 0
|
||||||
@ -63,7 +63,7 @@ def ButtonB_f_IRQHandler(pin):
|
|||||||
d = tt - last_tt
|
d = tt - last_tt
|
||||||
if pv:
|
if pv:
|
||||||
#print(" duration of inter-m space ", d)
|
#print(" duration of inter-m space ", d)
|
||||||
if d < rate*6:
|
if d < rate*3:
|
||||||
print (" ")
|
print (" ")
|
||||||
else:
|
else:
|
||||||
print (" interval ")
|
print (" interval ")
|
||||||
@ -234,13 +234,13 @@ def process_morse():
|
|||||||
printm(decode_morse())
|
printm(decode_morse())
|
||||||
morse = []
|
morse = []
|
||||||
last_was_space = 0
|
last_was_space = 0
|
||||||
last_sp = tt
|
last_sp = last_tt
|
||||||
#oled.clear()
|
#oled.clear()
|
||||||
#oled.displayText(rtc.readDateString(), 1, 25)
|
#oled.displayText(rtc.readDateString(), 1, 25)
|
||||||
#oled.displayText(rtc.readTimeString(), 2, 33)
|
#oled.displayText(rtc.readTimeString(), 2, 33)
|
||||||
#oled.displayText(str(mcount), 4, 33)
|
#oled.displayText(str(mcount), 4, 33)
|
||||||
#oled.show()
|
#oled.show()
|
||||||
if (tt - last_sp) > rate*15 : # and last_not_space == 0:
|
if (tt - last_sp) > rate*22 : # and last_not_space == 0:
|
||||||
if last_was_space == 0:
|
if last_was_space == 0:
|
||||||
printm(" ");
|
printm(" ");
|
||||||
last_was_space = 1 # dont keep repeating inter word spaces
|
last_was_space = 1 # dont keep repeating inter word spaces
|
||||||
|
Loading…
Reference in New Issue
Block a user