07.25
The Twittering Arduino board is finally complete. Finished it about 2:30AM last night and it successfully tweeted all night and all day today. My three followers are still following, I dont know how fascinating “Temperature Degrees C = 27.15 Temperature Degrees F = 80.87″ can be, but to each their own.
The actual act of twittering was pretty simple, there are several libraries to choose from, I used the Twittering Toilet program as a basis for my code. The hard part turned out to be building the actual text for the tweet, the Arduino has very limited string manipulation functions. But the PString library by Mikal Hart proved to be just what I needed.
The temperature sensor was easy, simply used the example provided by LadyAda at Adafruit Industries. I won’t bore you with a schematic, just do what is on the tutorial using ADC port 0.
TO DO:
- In reading the Twitter API later, I found that Twitter will ignore identical tweets, so it might be desirable to add the millis() value or some sort of serial numbering to make the tweets unique.
- Should implement some error checking. 99% of the tweets will be sucessful, but should look for rate limit hits and ignored tweets.
- I didn’t provide any code to hande the millis() rollover in about 50 days. I fear it will stop working, we shall see.
Oh yeah you can see it in action here
Share on Facebook