applause.py), and start the program with python applause.py. # When you press ctrl+c, this will be called If (current_state = False) and (prev_state = True): # Remember the current and previous button states In a new file, enter the following code: language:python In a terminal, enter the following: language:bash Raspbian Lite does not come with some Python packages pre-installed). Code: Push Button, Get SoundÄepending on your version of Raspbian, you may or may not have to install the pygame package (e.g. You should hear some nice cheering and clapping out of your speaker (or headphones). Test playing this sound with: language:bash Download a free sound clip (we'll go with some applause, because we're awesome): language:bash
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |