Creating a simple doorbell application with text messaging

To create our simple doorbell application do the following:

  1. Open up Thonny from Application Menu | Programming | Thonny Python IDE
  2. Click on the New icon to create a new file
  3. 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 ...

Get Internet of Things Programming Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.