1
1
# The MIT License (MIT)
2
2
#
3
- # Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
3
+ # Copyright (c) 2017, 2018 Scott Shawcroft for Adafruit Industries
4
4
#
5
5
# Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
# of this software and associated documentation files (the "Software"), to deal
@@ -130,7 +130,7 @@ def _play_to_pin(tune, base_tone, min_freq, duration, octave, tempo):
130
130
else :
131
131
base_tone .frequency = int (16000 * (PIANO [piano_note ] / min_freq ))
132
132
base_tone .play (loop = True )
133
- print ( piano_note , note_duration )
133
+
134
134
time .sleep (4 / note_duration * 60 / tempo )
135
135
if pwm :
136
136
base_tone .duty_cycle = 0
@@ -162,8 +162,6 @@ def play(pin, rtttl, octave=None, duration=None, tempo=None):
162
162
if not tempo :
163
163
tempo = 63
164
164
165
- print ("tempo" , tempo , "octave" , octave , "duration" , duration )
166
-
167
165
base_tone = None
168
166
min_freq = 440
169
167
if AUDIOIO_AVAILABLE :
@@ -179,3 +177,5 @@ def play(pin, rtttl, octave=None, duration=None, tempo=None):
179
177
base_tone = pulseio .PWMOut (pin , duty_cycle = 0 , variable_frequency = True )
180
178
181
179
_play_to_pin (tune , base_tone , min_freq , duration , octave , tempo )
180
+
181
+ base_tone .deinit ()
0 commit comments