Re: Re: Python
By: Mortifis to Minex on Mon Dec 10 2018 11:37:55
Mo> What is need is a counter so that the GPIO pins blink only for the length
Mo> of an mp3 then automagically shutdown when the song is over
What value does audio.info.length represent? Duration of the song in seconds /
milliseconds / something else? File size?
I doubt if a counter is the right way to go. Seems like you could store the
start time prior to entering the loop, and then make your While condition
something like 'current_time - start_time < song_duration', so that the loop
breaks once that amount of time has passed.
Mo> In the code I pasted to Nightfox the lights blink until ^C is hit
As expected, I assume.
---
echicken
electronic chicken bbs - bbs.electronicchicken.com - 416-425-5435
■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com
|