Twitter temperature

You will use the same electronics setup as the previous exercise. However, we will change the program so that it calls up the Arduino Temperature API.

We’ll tweet “It’s X degrees in X city! Tweet 1. #CTCYourCity” it to the common Twitter account.

Material:

  • Arduino YUN
  • 5st jumper wires
  • 2st 10k resistors (The colors on them are brown , black, orange and gold)
  • One push button
  • One LED
  • Breadboard

The next few steps are the same as the previous exercise. If you still have it built, then jump to step 2.

Modifying the code

  1. Construct the MDF parts to hold the button and RGB LED.
  2. Open “e2_temperature_twitter” from the examples.
  3. In the sketch, modify cityName to the city and countryCode to the country code.
  4. Change the hashtag to match the city where you are now (ex: #CTCLondon), not the city you are checking the temperature of.
  5. Make sure the button and LED are connected to the correct pins.
  6. Upload the sketch to the Yún.
  7. When the onboard LED L13 is on, the Yún is ready.
  8. Open the Serial Monitor and press the push button.
  9. When you see “Tweet sent” , go and check Twitter for your message. The shared Twitter account is:

As before if you wish to send more tweets, you need to change the content of the message first.