Hello Twitter World

In this exercise, we will connect button to “tweet” to a shared Twitter account. Each group will have a button that, when pressed, will tweet: “Hello Twitter World, from Team X! Tweet 1. #CTCYourCity”

Think of a really fun team name and let’s get started!
The shared Twitter account is: https://twitter.com/CTC_IoT

Refer to CTC IoT Teacher Guide #2.

Materials:

  • 1 Arduino YUN
  • 3 jumper wires
  • 1 10k resistor (The colors on it are brown, black and gold)
  • 1 Push button
  • 1 bread board

Assembling the MDF parts

  1. Tape RGB LED under top piece and insert the button.

Twitter1.jpg

  1. Assemble sides

Twitter2.jpg

  1. Attach wires to button and assemble last side

Twitter3.jpg

 

You can find the code in File -> Examples -> BasicEducationShield-> IoT -> e1_twitter

Modifying the code

  1. Open “e1_twitter” from the examples
  2. In the sketch, modify twitterMessage and customize the following text for your team: “Hello Twitter World, from Team X!”
  3. Change the hashtag to match the city where you are now (ex: #CTCLondon).
  4. Upload the sketch to the Yún.
  5. When the onboard LED L13 is on, the Yún is ready.
  6. Open the Serial Monitor and press the push button.
  7. When you see “Tweet sent” , go and check Twitter for your message.

Twitter will not allow duplicate tweets within a given time period, so the program includes an increment (“Tweet1”, “Tweet2” … “Tweet14”). It also places a limit 1 tweet every 10 seconds. If the tweet does not appear because it is a duplicate, try changing twitterMessage to something new.

Twitter hashtag search link: https://twitter.com/search?q=%23CHANGETHIS HASHTAG&src=tyah