To create our simple doorbell application do the following:
- Open up Thonny from Application Menu | Programming | Thonny Python IDE
- Click on the New icon to create a new file
- Type the following:
from twilio.rest import Clientfrom gpiozero import RGBLEDfrom gpiozero import Buzzerfrom bluedot import BlueDotfrom signal import pausefrom time import sleepclass Doorbell: account_sid = '' auth_token = '' from_phonenumber='' test_env = True led = RGBLED(red=17, green=22, blue=27) buzzer = Buzzer(26) num_of_rings = 0 ring_delay = 0 msg = '' def __init__(self, num_of_rings = 1, ring_delay = 1, message = 'ring', test_env = True): self.num_of_rings = num_of_rings self.ring_delay = ring_delay ...