User Manual
42
Check and set the channel, ranging between [0-7].
chn = pwm.channel # get channel
pwm.channel = 1 # set channel
frequency
Check and set the frequency.
freq = pwm.frequency # get pwm frequency
pwm.frequency = 60 # set pwm frequency
set_PWM(on, off=0)
Set the time period for high and low levels of PWM, ranging between [0, 4095].
pwm.set_PWM = 2048 # set pwm on_time
value
Set and acquire the time of high and low levels of PWM.
pwm_on_time = pwm.value # get pwm on_time
pwm.value = 2048 # set pwm on_time
tts.py
Convert the text into speech broadcast.
Create an instance, with a parameter engine for selecting the speech engine of
broadcasting from available ['festival', 'espeak', 'pico']; 'pico' by default if no engine is
choosen.
from pismart.tts import TTS
from pismart.pismart import PiSmart
p = PiSmart()
tts = TTS('pico') # create tts
p.speaker_volume(100)
say
SunFounder