put spaces in between words
This commit is contained in:
parent
0f5c3423b3
commit
1673016c5f
18
main.py
18
main.py
@ -222,20 +222,30 @@ def decode_morse():
|
|||||||
return("?")
|
return("?")
|
||||||
|
|
||||||
|
|
||||||
|
last_was_space = 0
|
||||||
|
last_sp = 0
|
||||||
def process_morse():
|
def process_morse():
|
||||||
global last_tt, morse
|
global last_tt, morse, last_was_space, last_sp
|
||||||
tt = time.ticks_ms()
|
tt = time.ticks_ms()
|
||||||
if (tt - last_tt) > 600:
|
if (tt - last_tt) > rate*6:
|
||||||
# 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 = 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 last_was_space == 0:
|
||||||
|
printm(" ");
|
||||||
|
last_was_space = 1 # dont keep repeating inter word spaces
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user