-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloftphonetest1.py
More file actions
32 lines (27 loc) · 784 Bytes
/
loftphonetest1.py
File metadata and controls
32 lines (27 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
from gpiozero import Button
from time import sleep
buttonOne = Button(18)
buttonTwo = Button(15)
buttonThree = Button(14)
volumeButton = Button(16)
ringerButton = Button(12)
def ringerOn():
os.system("mumble rpc unmute")
def ringerOff():
os.system("mumble rpc mute")
def volumeOn():
os.system("mumble rpc undeaf")
def volumeOff():
os.system("mumble rpc deaf")
while True:
if buttonOne.is_pressed:
#turn the speaker & the microphone on
os.system("mumble rpc undeaf")
#ring the bell
os.system("sudo python ringbell.py")
ringerButton.when_pressed = ringerOff
ringerButton.when_released = ringerOn
volumeButton.when_pressed = volumeOn
volumeButton.when_released = volumeOff
sleep(0.3)