Compare commits

..

No commits in common. "a920e282e54f1bd2169ead21d38e131de2f540d7" and "0f5c3423b32db5c763873f74d743c1a746255705" have entirely different histories.

22
main.py
View File

@ -17,7 +17,7 @@ zipleds = KitronikZIPLEDs(3)
# Python u arse hole sec = Integer()
rtc.setDate(16, 7, 2022)
rtc.setTime(12, 10, 0)
rate = 60 # 20 wpm
rate = 100
#bme688.setupGasSensor()
#bme688.calcBaselines()
sec = 0
@ -63,7 +63,7 @@ def ButtonB_f_IRQHandler(pin):
d = tt - last_tt
if pv:
#print(" duration of inter-m space ", d)
if d < rate*3:
if d < rate*6:
print (" ")
else:
print (" interval ")
@ -222,30 +222,20 @@ def decode_morse():
return("?")
last_was_space = 0
last_sp = 0
def process_morse():
global last_tt, morse, last_was_space, last_sp
global last_tt, morse
tt = time.ticks_ms()
if (tt - last_tt) > rate*6:
if (tt - last_tt) > 600:
# morse chacter complete
if (len(morse) > 0):
#print(morse)
print(morse)
printm(decode_morse())
morse = []
last_was_space = 0
last_sp = last_tt
#oled.clear()
#oled.displayText(rtc.readDateString(), 1, 25)
#oled.displayText(rtc.readTimeString(), 2, 33)
#oled.displayText(str(mcount), 4, 33)
#oled.show()
if (tt - last_sp) > rate*22 : # and last_not_space == 0:
if last_was_space == 0:
printm(" ");
last_was_space = 1 # dont keep repeating inter word spaces
oled.show()