Posts | Comments

Planet Arduino

Archive for the ‘twitter’ Category

Nov
07

Playing with sweets, photoresistors and Twitter

arduino, diy, StarterKit, sweets, tutorial, twitter Comments Off on Playing with sweets, photoresistors and Twitter 

TweetSweet
Martin sent us this fun project called TweetSweets, inspired by Labby’s twitter-enabled candy machine

How does it work? Easily explained:

- User1 sends a tweet with #givejacksweets
• Processing searches for the hashtag, sends a tweet thanking them and passes ‘sweets’ to Arduino
• Arduino activates sweet dispenser for 0.5 seconds
• Photoresistor detects when User2 collects them, and passes to Processing
• Processing takes a photo of User2 and tweets this to the User1
• User1 and User2 both smile :)

I’ve also cobbled together bits of code from other sources, including:

• a bit of Scott Fitzgerald’s PhotoResistor code from the Arduino Starter Kit book
• Twitter Processing sketch based on RobotGrrl Just a simple Processing and Twitter thingy majiggy‘ that I used for ‘I Am Iron Man
• Webcam code from Samuel Cox’s WeddingBooth
• Yonas Sandbak’s PostToWeb class

Funny thing is that this project didn’t start out involving sweets at all. Originally, I had planned to use NFC cards to allow people to quickly tap in, have a picture taken and then manipulate that image once it was on the server. Somewhere along the line I must have gotten hungry!

 

Oct
29

Tutorial – twitter and the Arduino Yún

arduino, lesson, temboo, tronixstuff, tutorial, twitter, wifi, Yun Comments Off on Tutorial – twitter and the Arduino Yún 

Introduction

After spending almost $100 on an Arduino Yún to see what the fuss was about, it seemed like a good idea to find and demonstrate some uses for it. So in this article we’ll examine how your Yún can send a tweet using some simple example sketches – and the first of several Arduino Yún-specific tutorials.

Getting Started

If you haven’t already done so, ensure your Arduino Yún can connect to your network via WiFi or cable – and get a Temboo account (we run through this here). And you need (at the time of writing) IDE version 1.5.4 which can be downloaded from the Arduino website. Finally, if you don’t have a twitter account – go get one.

Arduino Yun Yún front

Sending a tweet from your Yún

Thanks to Arduino and Temboo, 99% of the work is already done for you. To send a tweet requires the Arduino sketch, a header file with your Temboo account details, and also the need to register an application in the twitter development console.

Don’t panic, just follow the “Get Set Up” instructions from the following page. When you do – make sure you’re logged into the Temboo website, as it will then populate the header file with your Temboo details for you. During the twitter application stage, don’t forget to save your OAuth settings which will appear in the “OAuth Tool” tab in the twitter developer page, for example:

Arduino Yun OAuth twitter

… as they are copied into every sketch starting from the line:

const String TWITTER_ACCESS_TOKEN =

When you save the sketch, make sure you place the header file with the name TembooAccount.h in the same folder as your sketch. You know this has been successful when opening the sketch, as you will see the header file in a second tab, for example:

Arduino Yun sketch header file

Finally, if you’re sharing code with others, remove your OAuth and TembooAccount.h details otherwise they can send tweets on your behalf.

OK – enough warnings. If you’ve successfully created your Temboo account, got your twitter OAuth details, fed them all into the sketch and header file, then saved (!) and uploaded your sketch to the Arduino Yún - a short tweet will appear on your timeline, for example:

Arduino Yun twiiter

If nothing appears on your twitter feed, open the serial monitor in the IDE and see what messages appear. It will feed back to you the error message from twitter, which generally indicates the problem.

Moving on, let’s examine how to send tweets with your own information. In the following example sketch we send the value resulting from analogRead(0) and text combined together in one line. Don’t forget twitter messages (tweets) have a maximum length of 140 characters. We’ve moved all the tweet-sending into one function tweet(), which you can then call from your sketch when required – upon an event and so on. The text and data to send is combined into a String in line 26:

#include <Bridge.h>
#include <Temboo.h>
#include "TembooAccount.h" // contains Temboo account information
                           // as described in the footer comment below

const String TWITTER_ACCESS_TOKEN = "aaaa";
const String TWITTER_ACCESS_TOKEN_SECRET = "bbbb";
const String TWITTER_CONSUMER_KEY = "ccccc";
const String TWITTER_CONSUMER_SECRET = "dddd";

int analogZero;

void setup() 
{
  Serial.begin(9600);
  delay(4000);
  while(!Serial);
  Bridge.begin();
}

void tweet()
{
    Serial.println("Running tweet() function");

    // define the text of the tweet we want to send
    String tweetText("The value of A0 is " + String(analogZero) + ". Hooray for twitter");

    TembooChoreo StatusesUpdateChoreo;
    // invoke the Temboo client
    // NOTE that the client must be reinvoked, and repopulated with
    // appropriate arguments, each time its run() method is called.
    StatusesUpdateChoreo.begin();
    // set Temboo account credentials
    StatusesUpdateChoreo.setAccountName(TEMBOO_ACCOUNT);
    StatusesUpdateChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME);
    StatusesUpdateChoreo.setAppKey(TEMBOO_APP_KEY);
    // identify the Temboo Library choreo to run (Twitter > Tweets > StatusesUpdate)
    StatusesUpdateChoreo.setChoreo("/Library/Twitter/Tweets/StatusesUpdate");
    // add the Twitter account information
    StatusesUpdateChoreo.addInput("AccessToken", TWITTER_ACCESS_TOKEN);
    StatusesUpdateChoreo.addInput("AccessTokenSecret", TWITTER_ACCESS_TOKEN_SECRET);
    StatusesUpdateChoreo.addInput("ConsumerKey", TWITTER_CONSUMER_KEY);    
    StatusesUpdateChoreo.addInput("ConsumerSecret", TWITTER_CONSUMER_SECRET);
    // and the tweet we want to send
    StatusesUpdateChoreo.addInput("StatusUpdate", tweetText);
    // tell the Process to run and wait for the results. The 
    // return code (returnCode) will tell us whether the Temboo client 
    // was able to send our request to the Temboo servers
    unsigned int returnCode = StatusesUpdateChoreo.run();
    // a return code of zero (0) means everything worked
    if (returnCode == 0) {
        Serial.println("Success! Tweet sent!");
    } else {
      // a non-zero return code means there was an error
      // read and print the error message
      while (StatusesUpdateChoreo.available()) {
        char c = StatusesUpdateChoreo.read();
        Serial.print(c);
      }
    } 
    StatusesUpdateChoreo.close();
    // do nothing for the next 90 seconds
    Serial.println("Waiting...");
    delay(90000);
}

void loop()
{
  // get some data from A0. 
  analogZero=analogRead(0);
  tweet();
  do {} while (1); // do nothing
}

Which results with the following example tweet:

Arduino Yun sends twitter data

With the previous example sketch you can build your own functionality around the tweet() function to send data when required. Recall that the data to send as a tweet is combined into a String at line 26.

Please note that you can’t blast out tweets like a machine, for two reasons – one, twitter doesn’t like rapid automated tweeting – and two, you only get 1000 free calls on your Temboo account per month. If you need more, the account needs to be upgraded at a cost.

Conclusion

Well the Yún gives us another way to send data out via twitter. It wasn’t the cheapest way of doing so, however it was quite simple. And thus the trade-off with the Arduino platform – simplicity vs. price. If there is demand, we’ll examine more connected functions with the Yún.

And if you’re interested in learning more about Arduino, or want to introduce someone else to the interesting world of Arduino – check out my book (now in a third printing!) “Arduino Workshop” from No Starch Press.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The post Tutorial – twitter and the Arduino Yún appeared first on tronixstuff.

Aug
20

Twitter Knitter combines 40 year old hardware with modern social media

arduino, arduino hacks, Hackerspaces, knitting, servo, twitter Comments Off on Twitter Knitter combines 40 year old hardware with modern social media 

When presented with a vintage Empisal Knitmaster knitting machine, members of the TOG Dublin Hackerspace worked together to not only bring it back from the dead but to also add some custom hardware that allows for computer generated patterns.

At first the Knitmaster was in fairly bad shape requiring a few custom machined parts just to function.  It was originally designed to feed in special punch cards that mechanically directed the many moving parts of the machine (called “dibblers”) to knit patterns in yarn.  Using an Arduino, a number of servos, and a microswitch to detect when the knitting carriage is pulled across, this card-read system was replaced with a computer controlled mechanism that can direct the machine to print out images one row at a time.

Of course, you don’t get too many opportunities to name your project something as cute as “The Twitter Knitter”, so once the system was working, it was only a matter of writing some code to snatch tweets from the web and generate images out of the text.  Visitors of the Dublin Mini Maker Faire got to watch it in action as they posted tweets with a particular hashtag which the machine happily printed in yarn (as long as they weren’t too long).

Video demo after the jump.


Filed under: Arduino Hacks, Hackerspaces
Jun
03

Tweetosapien: Hack a Robosapien With Arduino to React to Tweets

arduino, Electronics, Robosapien, twitter Comments Off on Tweetosapien: Hack a Robosapien With Arduino to React to Tweets 

robosapien-pcbBored of your favorite Twitter client ? No problem, here’s the solution ! In this post we are going to explain how to control the awesome WowWee Robosapien with a wirelessly connected Arduino to trigger some actions on the robot through a specific Twitter hashtag.

Read the full article on MAKE

Over the last few years I’ve been writing a few Arduino tutorials, and during this time many people have mentioned that I should write a book. And now thanks to the team from No Starch Press this recommendation has morphed into my new book – “Arduino Workshop“:

shot11

Although there are seemingly endless Arduino tutorials and articles on the Internet, Arduino Workshop offers a nicely edited and curated path for the beginner to learn from and have fun. It’s a hands-on introduction to Arduino with 65 projects – from simple LED use right through to RFID, Internet connection, working with cellular communications, and much more.

Each project is explained in detail, explaining how the hardware an Arduino code works together. The reader doesn’t need any expensive tools or workspaces, and all the parts used are available from almost any electronics retailer. Furthermore all of the projects can be finished without soldering, so it’s safe for readers of all ages.

The editing team and myself have worked hard to make the book perfect for those without any electronics or Arduino experience at all, and it makes a great gift for someone to get them started. After working through the 65 projects the reader will have gained enough knowledge and confidence to create many things – and to continue researching on their own. Or if you’ve been enjoying the results of my thousands of hours of work here at tronixstuff, you can show your appreciation by ordering a copy for yourself or as a gift :)

You can review the table of contents, index and download a sample chapter from the Arduino Workshop website.

Arduino Workshop is available from No Starch Press in printed or ebook (PDF, Mobi, and ePub) formats. Ebooks are also included with the printed orders so you can get started immediately.

04/07/2013 – (my fellow) Australians – currently the easiest way of getting a print version is from Little Bird Electronics.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.


Over the last few years I’ve been writing a few Arduino tutorials, and during this time many people have mentioned that I should write a book. And now thanks to the team from No Starch Press this recommendation has morphed into my new book – “Arduino Workshop“:

shot11

Although there are seemingly endless Arduino tutorials and articles on the Internet, Arduino Workshop offers a nicely edited and curated path for the beginner to learn from and have fun. It’s a hands-on introduction to Arduino with 65 projects – from simple LED use right through to RFID, Internet connection, working with cellular communications, and much more.

Each project is explained in detail, explaining how the hardware an Arduino code works together. The reader doesn’t need any expensive tools or workspaces, and all the parts used are available from almost any electronics retailer. Furthermore all of the projects can be finished without soldering, so it’s safe for readers of all ages.

The editing team and myself have worked hard to make the book perfect for those without any electronics or Arduino experience at all, and it makes a great gift for someone to get them started. After working through the 65 projects the reader will have gained enough knowledge and confidence to create many things – and to continue researching on their own. Or if you’ve been enjoying the results of my thousands of hours of work here at tronixstuff, you can show your appreciation by ordering a copy for yourself or as a gift :)

You can review the table of contents, index and download a sample chapter from the Arduino Workshop website.

Arduino Workshop is available from No Starch Press in printed or ebook (PDF, Mobi, and ePub) formats. Ebooks are also included with the printed orders so you can get started immediately.

LEDborder

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The post Book – “Arduino Workshop – A Hands-On Introduction with 65 Projects” appeared first on tronixstuff.

Dec
24

WhiteSpace TweetTrain

#tweettrain, arduino, gallery, twitter, wifly Comments Off on WhiteSpace TweetTrain 

Somebody knows how to have fun in the office and with Arduino. Have a look at this project by [whitespacers] powered with our boards

Christmas is a time of gathering the family around and enjoying the simple things in life. And what could be simpler than a good old fashioned train set… powered by tweets?

Tweeters can simply send a message to #tweettrain then enjoy the ride via the onboard camera streaming to whitespacers.com/tweettrain as they puff their way round the Whitespace HQ Winter Wonderland.

The magic also lets tweeters control the Tweet Train’s direction and speed by telling it to go in ‘reverse’ or ‘fast’.

Iain Valentine, creative director and Whitespace Santa said: “When visual, digital and experiential marketing are linked effectively, it can seem like magic. We wanted to bring our clients something special for the festive season and so our elves were kept busy bringing the late 19th century Christmas gift of choice into the digital age. Deep down, everyone wants a toy train set for Christmas!”

If you’re wondering which particular type of Christmas magic we used; it’s the extra special Arduino-micro-controller coupled with a wifi receiver type.

You see Santa’s elves replaced the Tweet Train’s manual train controller with a wifi receiver so the train can be controlled by digital commands. Tweets containing the hashtag #tweettrain are searched for, simplified, and sent to a new URL that the arduino checks for new tweets. Each time it spots one, it powers the train motors. Magic basically.

We reckon it gives the Hogwarts Express a run for its chocolate money, but why not try it for yourself? Visit. Tweet. Drive the train. The station is in live cam on the [website]

Dec
20

TFTweet – Displaying Tweets on an Arduino Shield with the Raspberry Pi

AlaMode, arduino, DIY Projects, Raspberry Pi, TFT Display, twitter Comments Off on TFTweet – Displaying Tweets on an Arduino Shield with the Raspberry Pi 

20121202_031332Drew Fustini recently got his hands on an AlaMode and used it display tweets from his Raspberry Pi to an 2.8" TFT LCD Touchscreen Shield. The AlaMode and shield are connected to the Raspberry Pi which runs the Arduino IDE and a bit of Python code to make it all happen.

Read the full article on MAKE

Dec
12

twitter-radio

This anthropomorphized wood bowl will read Tweets out loud. It was built by [William Lindmeier] as part of his graduate work in the Interactive Telecommunications Program (ITP) at New York University. View the clip after the break to see and hear a list from his Twitter feed read in rather pleasant text-to-speech voices.

The electronics involved are rather convoluted. Inside the upturned bowl you’ll find both an Arduino and a Raspberry Pi. But that’s not the only thing that goes into this. The best sounding text-to-speech program [William] could find was for OSX, so there is a remote computer involved as well. But we think what makes this special is the concept and execution, not the level of hardware inefficiency.

The knob to the left sets the volume and is also responsible for powering down the device. The knob of the right lets you select from various Twitter lists. Each turn of the knob is responded to with a different LED color in the nose and a spoken menu label. You can get a quick overview of the project from this summary post.


Filed under: arduino hacks, Raspberry Pi
Nov
20

Social Drink Machine (powered with Arduino)

arduino, drink, facebook, gallery, qrcode, romania, socials, twitter Comments Off on Social Drink Machine (powered with Arduino) 

This time Arduino for drinks, always from Romania.

Do you know what you get if you combine Facebook, Twitter, Arduino, Raspberry PI and alcohol ? Well, you get the Social Drink Machine and a lot of really happy people at HowToWeb Bucharest.
The Social Drink Machine involves a fully enabled robotic bar which prepares your dream cocktail, a Facebook application which you use to order the drink and also a Twitter bot as an alternative ordering method.

In order to “drink with Facebook”, all you have to do is to scan the QR code displayed next to the machine with your mobile phone. It will get you to a Facebook application which enables you to choose the drink you want. Once you have decided what you want to drink, the application displays a large QR code on your mobile phone. You show this to the machine camera, and you will get your drink prepared. Actually, a robotic machine will prepare it for you. All you have to do is to place the glass, which is then moved back and forth until all of the ingredients have been mixed. And if you wanna brag about this, the application allows you to post on Facebook about the crush you just got on the cool robotic bartender.

[Robofun - Create] also made this.



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook