Skip to content

Commit

Permalink
Updated the code
Browse files Browse the repository at this point in the history
  • Loading branch information
CrypticScience authored Sep 30, 2020
1 parent 254ef11 commit 1366ac2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions shortcutmaster.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Shortcut Master for Raspberry Pi Version 1.0
# Shortcut Master for Raspberry Pi Version 1.1
# This is the main code for the program, it was designed by SC13NC3F1CT10N (username)
# Version code started 04/09/2020 and ended 04/10/2020
# Version code made 04/10/2020


## SETUP ##
Expand All @@ -24,6 +24,11 @@ def wunp(): # Create wunp (wait until not pushed) function
while GPIO.input(10) == GPIO.HIGH:
pass

sound = True # Set to False if you don't want sound or set to True if you want sound

def playsound(): # This function plays sound when sound is enabled.
if sound == True:
system("mpg123 /home/pi/ShortcutMaster_Raspberry-Pi/sounds/launch.mp3")
# Let the user know the program is ready to begin
GPIO.output(8, GPIO.HIGH)
print("Ready")
Expand All @@ -34,22 +39,27 @@ def wunp(): # Create wunp (wait until not pushed) function
# If button (1 to 4) is pushed, execute set command then stop the script
if GPIO.input(10) == GPIO.HIGH:
print("Execute: " + func1)
playsound()
system(func1)
stop = True
wunp()
if GPIO.input(12) == GPIO.HIGH:
print("Execute: " + func2)
playsound()
system(func2)
stop = True
wunp()
if GPIO.input(16) == GPIO.HIGH:
print("Execute: " + func3)
playsound()
system(func3)
stop = True
wunp()
if GPIO.input(18) == GPIO.HIGH:
print("Execute: " + func4)
playsound()
system(func4)
stop = True
wunp()

print("Goodbye")

0 comments on commit 1366ac2

Please sign in to comment.