Skip to content

Instantly share code, notes, and snippets.

@RameshRM
Created February 25, 2017 20:10
Show Gist options
  • Save RameshRM/3356d77828f91e77c50f29fa5dc4bfac to your computer and use it in GitHub Desktop.
Save RameshRM/3356d77828f91e77c50f29fa5dc4bfac to your computer and use it in GitHub Desktop.
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
pin_to_circuit=7
GPIO.setup(pin_to_circuit, GPIO.OUT)
from twilio.rest import TwilioRestClient
from twilio.rest import TwilioRestClient
account_sid = "AC400cf60ec454f49f89bb830e40e36092" # Your Account SID from www.twilio.com/console
auth_token = "0b8c584c59b0592e99aafdb210b3d2ee" # Your Auth Token from www.twilio.com/console
client = TwilioRestClient(account_sid, auth_token)
message = client.messages.create(body="Your lighs are on",
to="+16308773409", # Replace with your phone number
from_="+14082148483") # Replace with your Twilio number
GPIO.output(pin_to_circuit, GPIO.HIGH)
while True:
print(message.sid)
time.sleep(300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment