Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from twilio.rest import TwilioRestClient
- import RPi.GPIO as GPIO
- import time
- account = "AC96b9ba465fb7daaf18d00b551f0b3707"
- token = "b60cfa7c831b40a00e2aa324bb9bad43"
- client = TwilioRestClient(account, token)
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
- while True:
- input_state = GPIO.input(18)
- if input_state == False:
- print('Button Pressed')
- message = client.messages.create(to="+12244029741", from_="+12245237919", body="Your baby is in the seat")
- print ('Message sent')
- time.sleep(0.2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement