Fixed say-temp demo
This commit is contained in:
parent
efc31d7bda
commit
a84e197262
1 changed files with 6 additions and 1 deletions
|
|
@ -11,6 +11,11 @@ import audioio
|
|||
import audiocore
|
||||
from digitalio import DigitalInOut, Direction, Pull
|
||||
|
||||
# Enables the speaker for audio output
|
||||
spkrenable = DigitalInOut(board.SPEAKER_ENABLE)
|
||||
spkrenable.direction = Direction.OUTPUT
|
||||
spkrenable.value = True
|
||||
|
||||
D1 = board.BUTTON_A
|
||||
D2 = board.BUTTON_B
|
||||
|
||||
|
|
@ -43,7 +48,7 @@ def play_file(wavfile):
|
|||
# Function should take an integer -299 to 299 and say it
|
||||
# Assumes wav files are available for the numbers
|
||||
def read_temp(temp):
|
||||
play_file("temperature.wav")
|
||||
play_file("The temperature is.wav")
|
||||
if temp < 0:
|
||||
play_file("negative.wav")
|
||||
temp = - temp
|
||||
|
|
|
|||
Loading…
Reference in a new issue