Compare commits
No commits in common. "a920e282e54f1bd2169ead21d38e131de2f540d7" and "0f5c3423b32db5c763873f74d743c1a746255705" have entirely different histories.
a920e282e5
...
0f5c3423b3
22
main.py
22
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 = 60 # 20 wpm
|
rate = 100
|
||||||
#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*3:
|
if d < rate*6:
|
||||||
print (" ")
|
print (" ")
|
||||||
else:
|
else:
|
||||||
print (" interval ")
|
print (" interval ")
|
||||||
@ -222,30 +222,20 @@ def decode_morse():
|
|||||||
return("?")
|
return("?")
|
||||||
|
|
||||||
|
|
||||||
last_was_space = 0
|
|
||||||
last_sp = 0
|
|
||||||
def process_morse():
|
def process_morse():
|
||||||
global last_tt, morse, last_was_space, last_sp
|
global last_tt, morse
|
||||||
tt = time.ticks_ms()
|
tt = time.ticks_ms()
|
||||||
if (tt - last_tt) > rate*6:
|
if (tt - last_tt) > 600:
|
||||||
# morse chacter complete
|
# morse chacter complete
|
||||||
if (len(morse) > 0):
|
if (len(morse) > 0):
|
||||||
#print(morse)
|
print(morse)
|
||||||
printm(decode_morse())
|
printm(decode_morse())
|
||||||
morse = []
|
morse = []
|
||||||
last_was_space = 0
|
|
||||||
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*22 : # and last_not_space == 0:
|
|
||||||
if last_was_space == 0:
|
|
||||||
printm(" ");
|
|
||||||
last_was_space = 1 # dont keep repeating inter word spaces
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user