Write the following code into a new Sketch in the WebIDE.
// Message to Post
charmsg="Hi, I'm a tweet from a Spark Core!";
// OAuth Key
#define TOKEN "OAuth"
// Twitter Proxy
#define LIB_DOMAIN "arduino-tweet.appspot.com"
client.println("POST /update HTTP/1.0");
Step 7: Token replacment
At the top of the code you’ll see a line called #define TOKEN “OAuth”. Replace the word OAuth with the long string you got in Step 1. (Be sure you keep the quotes around your OAuth string!)
Step 8: Save, Verify and Flash your code
Step 9: Check your twitter account
You can only send around one tweet per minute, so don’t run this code in the main loop!
Finally, let’s move to the last method using 1Sheeld with Arduino UNO, ths one is the easiet way, you only write 1 line of code!
Step 1: Adjust 1Sheeld
Warning! If you have the Arduino Due or any board that works on 3.3V, you must switch your 1Sheeld to operate on 3.3V since it may damage your board. To switch 1Sheeld to 3.3V locate the toggle switch on the top of the board and switch it to the 3.3V position.
Step 2: Place your 1Sheeld on your Arduino board then plug the Arduino to your laptop or PC
Step 3: Download 1Sheeld Application onto your smart phone. Our app is available on the Google play store at http://1sheeld.com/app
Step 4: Download 1Sheeld library
Download OneSheeld library to your computer through this link
Step 5: Extract the folder, copy it, and paste it in your Arduino libraries directory.
Step 6: Write your Sketch
Open the Arduino IDE on your computer, choose Twitter example from OneSheeld library.
/* Include 1Sheeld library. */
/* Start communication. */
Twitter.tweet("I'm tweeting from Arduino via 1Sheeld!");
// Put you own code here
Step 7: Upload your sketch
Here comes the most important part of the whole tutorial, switch 1Sheeld to the Uploading-mode (this is the switch labeled UART Switch on the board) before you upload your sketch to the Arduino board to avoid serial conflicts between 1Sheeld and Arduino, then press the Upload button in the IDE.
Upload mode is turned on when the UART switch is pushed away from the 1Sheeld logo.
Once you have completed your upload you need to switch 1Sheeld back to the operating mode. Don’t forget! If you don’t switch the UART Switch back to the operating mode your project will not work properly as you will have no communication between 1Sheeld and the Arduino board.
Operating mode is turned on when the UART switch is pushed closest to the 1Sheeld logo.
Step 8: Use 1Sheeld Application
Open 1Sheeld application on your Android smart phone. The application will first scan over bluetooth for your 1Sheeld, it will take a few seconds and the phone will find it. Once it appears on your screen as 1Sheeld #xxxx, you will be required to enter the pairing code (the default pairing code is 1234) and connect to 1Sheeld via bluetooth.
NOTE: If you are having trouble please make sure the bluetooth is turned on for your Android phone and that the Android phone is close to your 1Sheeld.
Step 9: Access Shields
Select the shields you would like to use in your Arduino sketch (project) and press on the multiple shields icon at the top right of the app.
In this case, use Twitter Shield then login using your account.
Now let’s compare between the 3 methods to choose the suitable method to use.
Size of Code
Arduino + Ethernet Shield
Actually 1 line of code 🙂
Here’s a tutorial video on how to post on Twitter with 1Sheeld:
Arduino makers …. you can connect your Arduino to MQTT brokers(servers) and launch your IoT with Arduino IoT Shield! It’s the 1Sheeld IoT shield that will do the job for you. It’s one of the most important but recent Arduino shields in 1Sheeld. Simply, it turns your Arduino into MQTT client where you can publish and …
Monitor my home environmental parameters remotely is one of the most desirable things I have ever wanted to make. It’s not about purchasing such a system that can get the job done for me. But, passion to create it myself. So, today, I am going to connect the popular DHT sensor to an online MQTT …
“Oh God! … It seems like I have forgotten the door lock open, again” … the normal saying whenever I am in hurry to go out! Have you encountered this problem before? It always confuses me since I may even think that I have left the door lock opened, and once I go back, …
Here I am with another IoT-based home automation project; Arduino IoT Fan Control. Every day, I get back from work tired and feeling hot. No air conditioner here and the fan takes much time to start cooling the room, sadly! So, I was thinking why not controlling the fan from outside my home with my …
Have you ever forgotten to turn your home lights off when you got outside? Sadly, it happens to me all the time. And this causes confusion once I get my bills! Furthermore, here is one secret about me; I am a lazy man. I always want to control my room lamp from my sweet bed. …
Welcome to our home automation hacks series #3, for so many times I had problems with watering my plants while traveling abroad and I have always needed a way to control it remotely, then I decided to do it with one of the fanciest ways you may ever hear off, cause I’m gonna water my …