Skip to content

Commit a84e197

Browse files
committed
Fixed say-temp demo
1 parent efc31d7 commit a84e197

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Make_It_Talk/say-temp.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
import audiocore
1212
from digitalio import DigitalInOut, Direction, Pull
1313

14+
# Enables the speaker for audio output
15+
spkrenable = DigitalInOut(board.SPEAKER_ENABLE)
16+
spkrenable.direction = Direction.OUTPUT
17+
spkrenable.value = True
18+
1419
D1 = board.BUTTON_A
1520
D2 = board.BUTTON_B
1621

@@ -43,7 +48,7 @@ def play_file(wavfile):
4348
# Function should take an integer -299 to 299 and say it
4449
# Assumes wav files are available for the numbers
4550
def read_temp(temp):
46-
play_file("temperature.wav")
51+
play_file("The temperature is.wav")
4752
if temp < 0:
4853
play_file("negative.wav")
4954
temp = - temp

0 commit comments

Comments
 (0)