So, you've got this cool new Edison, but what to do with it? Well, it DOES talk to the internet fairly well, so let's make it talk to the internet!

Interestingly enough, the ethernet libraries for Arduino work just as well on the Edison, so why not use them?

I am piggybacking off of a very good tutorial found here: http://arduino-tweet.appspot.com/
As a result of my piggybacking, I am using (and trusting) NeoCat's app that gets the twitter token you will need to tweet with your Edison. While I am a rather trusting person (perhaps destructively so), you may want to dig around to get your token from https://dev.twitter.com/ . Unfortunately, at the time of writing this, the developer site is by invite only....so NeoCat's option was definitely the best.

So, to get started, visit NeoCat's website, follow his/her tutorial to get the twitter library and your twitter token: http://arduino-tweet.appspot.com/

As NeoCat mentioned on their site, please don't abuse the service. Keep your tweets sparse. If you need something that tweets every 6 seconds, you should set up your own server and twitter app.

I am also counting on the fact (it IS a fact, right?) that you have already gone through the Getting Started tutorials Intel has so kindly made for us. You can find them here: https://communities.intel.com/docs/DOC-23147

And, of course, FOLLOW ME ON TWITTER! @foxrobotics

Step 1: Let's add some sensors

A randomly tweeting Edison can be fun, but let's add some sensors to it.

For this instructable, I will be using the Grove Starter Kit for Edison to save myself a bit of time. I'm normally a proponent of breadboards and custom circuit boards, but hey, why not? You can easily replicate this by connecting a button yourself that has a 10k pull down resistor. Search for "Arduino button circuit" online to find it.

In this example, I will be connecting the button to D8. I will also be connecting a light sensor to A0 (again, search "Arduino light sensor" for explicit circuits). Connect them as shown in the picture if you have the same Grove kit.

<p>Hi There,</p><p>Love the instructable! I just got my board through today and have been tinkering around with it, I have uploaded your code and used my twitter auth token, however when I press the button it doesn't tweet anything? Is there a way to view logs etc?</p><p>Thanks,</p><p>Ainsey11</p>
A few ideas:<br> <br> 1) Are you using the token you got from NeoCat's website or are you using one that you have gotten previously? I haven't looked too deeply into it, but I would be willing to be that your actual twitter token and the one being used for NeoCat's tweeting service are different. Since the library goes to NeoCat's twitter app, you would need his/her token for your account. You also have to give NeoCat's app the permission to post for you.<br> <br> 2) Have you set up your wifi? Is it still connected? You can test this by opening your Edison in an SSH terminal (like putty), logging in, and then typing &quot;ping www.instructables.com&quot;. If you are connected to the internet, you should get a response back.<br> <br> 3) You are sending a lot of identical tweets back to back and Twitter is blocking them. Make sure you have a delay like I show in the code (or add more sophisticated debounce), that your button is wired correctly (you should have a 10k pull-down resistor to ground), that your button is on the correct pin, and that your button is working. To test if your button is working, open the Arduino IDE for Edison and type the following. If your button works, you should get a bunch &quot;It works!&quot; on your serial monitor.<br> void setup(){ pinMode(8, INPUT); Serial.begin(9600);}<br> void loop(){if(digitalRead(8) Serial.println(&quot;It works!&quot;);}<br> <br> 4) You can try NeoCat's code to debug the connection. Replace &quot;twitter.post(msg)&quot; with this:<br> <br> if (twitter.post(msg)) {<br> &nbsp;&nbsp;&nbsp; int status = twitter.wait();<br> &nbsp;&nbsp;&nbsp; if (status == 200) {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Serial.println(&quot;OK.&quot;);<br> &nbsp;&nbsp;&nbsp; } else {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Serial.print(&quot;failed : code &quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Serial.println(status);<br> &nbsp;&nbsp;&nbsp; }<br> &nbsp; } else {<br> &nbsp;&nbsp;&nbsp; Serial.println(&quot;connection failed.&quot;);<br> &nbsp; }
<p>Thanks for getting back to me!</p><p>Turns out I had my button connected to the wrong connector!</p><p>DUUhhhh :D</p><p>Cheers!,</p><p>Ainsey11</p>
<p>Heheh, glad you figured it out ^-^</p>
<p>Awesome instructable! And that identical tweets thing caught me off guard, almost made me go mad that it wasn't working even though the code was perfect!</p>
<p>does the #include&lt;Ethernet.h&gt; support the Intel edison being connected to wifi instead of ethernet over usb.</p><p>In short does your code work for edison boards connected to wifi?</p>
<p>Thanks. I made it.<br>Now time to read from twitter timeline.</p>
<p>I made it. Thanks!</p>
<p>Hi A_Steingrube,</p><p>I wanted to display a tweet in my 16*2 Grove RGB LCD Display!</p><p>Can you help me with the code!</p><p>Thanks alot !</p><p>Regards,</p><p>Geeve</p>

About This Instructable




Bio: I'm an Electrical Engineer who dabbles in just about everything. By trade, I'm a controls engineer and design machines for the largest manufacturing ... More »
More by A_Steingrube:Quick and Dirty Mosquito Trap Send Texts with Intel Edison (Party Alarm) Email with Intel Edison (Intruder Alarm) 
Add instructable to: