1818 )
1919 def wave_prog ():
2020 pull (block )
21- mov (x , osr ) # waveCount
21+ mov (x , osr ) # waveCount
2222 pull (block )
2323 label ("loop" )
24- mov (y , osr ) # halfWaveNumCycles
25- set (pins , 1 ) # high
24+ mov (y , osr ) # halfWaveNumCycles
25+ set (pins , 1 ) # high
2626 label ("high" )
2727 jmp (y_dec , "high" )
28- mov (y , osr ) # halfWaveNumCycles
29- set (pins , 0 ) # low
28+ mov (y , osr ) # halfWaveNumCycles
29+ set (pins , 0 ) # low
3030 label ("low" )
3131 jmp (y_dec , "low" )
3232 jmp (x_dec , "loop" )
@@ -38,23 +38,13 @@ def wave_prog():
3838 def HWPlayTone (freq : int , duration : int ):
3939 halfWaveNumCycles = round ((100000.0 / 2 ) / freq ) # 2 is the number of cycles per half wave
4040 waveCount = round (duration * freq / 1000.0 )
41- #print(". freq", freq)
42- #print(". duration", duration)
43- #print(". halfWaveNumCycles", halfWaveNumCycles)
44- #print(". waveCount", waveCount)
45- #sm.active(1)
46- #start_ms = time.ticks_ms()
4741 sm .put (waveCount )
4842 sm .put (halfWaveNumCycles ) # 2 * (x / 10) == blink time
49- # res = sm.get()
50- # #taken_ms = time.ticks_ms() - start_ms
51- # #print(f"= got result {res} in {taken_ms:.2} ms")
52- # sm.active(0)
5343except :
5444 print ("*****" )
55- print ("* No HWPlayToneBlocked " )
45+ print ("* No HWPlayTone " )
5646 print ("*****" )
57- HWPlayToneBlocked = None
47+ HWPlayTone = None
5848
5949
6050Song = "G C E C E D C A G G C E C E D G E G E G E C G A C C A G G C E C E D C Z"
@@ -97,7 +87,6 @@ def HWPlayTone(freq: int, duration: int):
9787
9888BeatSpeed = 300
9989
100- #TOP_HEIGHT = 30
10190TOP_HEIGHT = 50
10291KEY_WIDTH = 14
10392KEY_HEIGHT = 80
@@ -172,8 +161,6 @@ def __init__(self):
172161 self .playToSpeaker = False
173162 self .restart = False
174163 self .adhocFreq = - 1
175- #self.lyricColIdx = -1
176- #self.lyricRowIdx = -1
177164
178165 dd .recordLayerSetupCommands ()
179166
@@ -191,7 +178,7 @@ def __init__(self):
191178 self .lyricLayer .margin (2 )
192179 self .lyricLayer .border (2 , "blue" , "round" )
193180 self .lyricLayer .backgroundColor ("lightgray" )
194- self .lyricLayer .setTextFont ("DL::Roboto" )
181+ self .lyricLayer .setTextFont ("DL::Roboto" ) # use the downloaded font Roboto ... https://fonts.google.com/specimen/Roboto
195182
196183 if not HWPlayTone :
197184 self .targetLayer .disabled ()
0 commit comments