Avoid making your friends worry by telling them when you safely arrive home or when you're busy studying your lessons or doing other stuff by uploading a tweet to your Twitter account automatically.
Send a tweet when you press the button or make the LDR sense light from your lamp shade, this means you're busy. (Set the LDR beside your lamp shade's bulb to make a trigger for when you turn on the lamp.)
Setup- Build the circuit (look for Schematics>circuit)
- Save the Tweet Trigger Code as "TweetButton.ino" then open your Arduino IDE.
- Save the Send Tweet Code as "SendTweet.py" then open your Python IDLE (please don't run the module).
- Install the Twitter application (https://apps.twitter.com) - make sure to change permissions to "Access level read, write, and direct messages".
- Change "Consumer Key (API Key)", "Consumer Secret (API Secret)", "AccessToken", "Access Token Secret" on your Python code to your Twitter token and access values.
- Setup your IFTTT account then create a Recipe (connect your Twitter & Samsung Artik account).
- Connect the Arduino UNO to your computer and set your Board and Serial Port under Tools menu on Arduino IDE.
- On your Arduino IDE, Click Verify then Upload.
- On Python Idle, Run Module / Press F5. This will wait for the serial write / response from your board.
- Press the tact switch or give light to your LDR to make a trigger.
If the switch is pressed:
- '1' will be sent to python via serial to Tweet "Hi friends I'm home! (Sent by Python script) #home... "
If the LDR senses light:
- '2' will be sent to python via serial to Tweet "I'm busy right now... "
- Green light will turn on for 3 seconds.
- Tweet will be posted to Twitter with #home or #busy.
- IFTTT will trigger the recipe if the new tweet is posted.
- Artik device will receive the action "setOn".
Comments