Arduino Twitter Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Arduino Twitter Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld

Bringing twitter into your Arduino sketch. Twitter shield allows you to send tweets with only 1 line of code in your sketch.

This shield is one of the social media shields. Social media shields allow you to use your Arduino board to access your favorite social media applications, using your smartphone as a channel between them.Learn more from the social media shields tutorial.

Twitter  library allows Arduino board to post, track words, get tweets and upload pictures through 1Sheeld application.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_TWITTER_SHIELD is a key that will let you unlock the Twitter shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

Note

For Android M(6) or greater, there are permissions to be granted before using the Data Logger shield, please make sure to grant the permissions or else it may affect the application’s performance.

void tweet(const char*)

Post a tweet using your account.

 

SYNTAX
Twitter.tweet(tweet);

 

RETURNS
None.

 

PARAMETERS
Takes a const char array holding the text to be tweeted.

 

USAGE
Twitter.tweet(“tweetToBePosted”);

 

void tweet(String)

Post a tweet using your account.

 

SYNTAX
Twitter.tweet(tweet);

 

RETURNS
None.

 

PARAMETERS
Takes a string object holding the text to be tweeted.

 

USAGE
String sentence = “tweetToBePosted”;
Twitter.tweet(sentence);

 

void sendMessage(const char *,const char *)

Send a direct message to a certain account.

 

SYNTAX
Twitter.sendMessage(accountName , message);

 

RETURNS
None.

 

PARAMETERS
1st Parameter takes const char array holding accountName.
2nd Parameter takes const char array holding body message

 

USAGE
Twitter.sendMessage (“accountName”,“messageBody”);

 

void sendMessage(String,String)

Send a direct message to a certain account.

 

SYNTAX
Twitter.sendMessage(accountName , message);

 

RETURNS
None.

 

PARAMETERS
1st Parameter takes string object holding accountName.
2nd Parameter takes string object holding body message

 

USAGE
String name = “accountName”;
String message = “messageBody”;
Twitter.sendMessage(name,message);

 

void isNewTweet(void)

Checks if there’s a new incoming tweet.

 

SYNTAX
Twitter.isNewTweet( );

 

RETURNS
Returns a yes “1” or no “0”;

 

PARAMETERS
None.

 

USAGE
Twitter.isNewTweet();

 

void tweetLastPicture(const char *,byte)

Posts last picture taken by your smartphone camera with the option to upload the picture from OneSheeld folder or Camera folder.

 

Literals:
FROM_ONESHEELD_FOLDER(default)
FROM_CAMERA_FOLDER

 

SYNTAX
Twitter.tweetLastPicture(status,folderDirectory);

 

RETURNS
None.

 

PARAMETERS
1st Parameter takes const char array holding the text status to be posted.
2nd Parameter takes a byte holding the number to upload picture from OneSheeld folder “0” or Camera folder”1″.

 

USAGE
Twitter.tweetLastPicture(“status to be posted on facebook along the picture” , FROM_CAMERA_FOLDER );

 

void tweetLastPicture(String,byte)

Posts last picture taken by your smartphone camera with the option to upload the picture from OneSheeld folder or Camera folder.

 

Literals:
FROM_ONESHEELD_FOLDER(default)
FROM_CAMERA_FOLDER

 

SYNTAX
Twitter.tweetLastPicture(status,folderDirectory);

 

RETURNS
None.

 

PARAMETERS
1st Parameter takes string object holding the text status to be posted.
2nd Parameter takes a byte holding the number to upload picture from OneSheeld folder “0” or Camera folder”1″.

 

USAGE
String status = “status to be written to facebook along the picture”;
Twitter.tweetLastPicture(status , FROM_ONESHEELD_FOLDER);

 

void trackKeyword(const char *)

Track a certain word over the whole tweets posted by the whole globe.

 

SYNTAX
Twitter.trackKeyword(keywordToBeTracked);

 

RETURNS
None.

 

PARAMETERS
Takes a const char array holding the keyword text value.

 

USAGE
Twitter.trackKeyword(“1Sheeld”);

 

void trackKeyword(String)

Track a certain word over the whole tweets posted by the whole globe.

 

SYNTAX
Twitter.trackKeyword(keywordToBeTracked);

 

RETURNS
None.

 

PARAMETERS
Takes a string object holding the keyword text value.

 

USAGE
String keyword = “1Sheeld”;
Twitter.trackKeyword(keyword);

 

void untrackKeyword(const char *)

Stops tracking the already tracked keyword.

 

SYNTAX
Twitter.untrackKeyword(keywordToBeUntracked);

 

RETURNS
None.

 

PARAMETERS
Takes a const char array holding the keyword text value.

 

USAGE
Twitter.untrackKeyword(“1Sheeld”);

 

void untrackKeyword(String)

Stops tracking the already tracked keyword.

 

SYNTAX
Twitter.untrackKeyword(keywordToBeUntracked);

 

RETURNS
None.

 

PARAMETERS
Takes a string object holding the keyword text value.

 

USAGE
String keyword = “1Sheeld”;
Twitter.untrackKeyword(keyword);

 

char * getTweet(void)

Gets a tweet with the tracked word.

 

SYNTAX
Twitter.getTweet();

 

RETURNS
Returns a char array holding the tweet with the tracked keyword.

 

PARAMETERS
None.

 

USAGE
char* myArray = Twitter.getTweet( );

 

String getTweetAsString(void)

Gets a tweet with the tracked word.

 

SYNTAX
Twitter.getTweet();

 

RETURNS
Returns a string object holding the tweet with the tracked keyword.

 

PARAMETERS
None.

 

USAGE
String mytweet = Twitter.getTweetAsString();

 

char * getUserName(void)

Gets the user name who tweeted the post with the tracked word.

 

SYNTAX
Twitter.getUserName();

 

RETURNS
Returns a char array holding the username.

 

PARAMETERS
None.

 

USAGE
String mytweet = Twitter.getUserName();

 

String getUserNameAsString(void)

Gets the user name who tweeted the post with the tracked word.

 

SYNTAX
Twitter.getUserName();

 

RETURNS
Returns a string object holding the username.

 

PARAMETERS
None.

 

USAGE
String mytweet = Twitter.getUserNameAsString();

 

void setOnNewTweet(void(*userFunction)(char *,char *))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a tweet with a certain tracked word is sent by the application.

 

SYNTAX
Twitter.setOnNewTweet(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
Twitter.setOnNewTweet(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new tweet comes with the tracked word. */
void myFunction (char * userName,char * tweetText)
{
    /* Print out the phone userName and tweetTexton Terminal shield. */
    Terminal.println(userName);
    Terminal.println(tweetText);
}

 

void setOnNewTweet(void(*userFunction)(String,String))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a tweet with a certain tracked word is sent by the application.

 

SYNTAX
Twitter.setOnNewTweet(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
Twitter.setOnNewTweet(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new tweet comes with the tracked word. */
void myFunction (char * userName,char * tweetText)
{
    /* Print out the phone userName and tweetTexton Terminal shield. */
    Terminal.println(userName);
    Terminal.println(tweetText);
}

 

void setOnTwitterSelected(void(*userFunction)(void))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a twitter shield is selected in the application.

 

SYNTAX
Twitter.setOnTwitterSelected(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
Twitter.setOnTwitterSelect(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked once you select Twitter shield in the application. */
void myFunction (void)
{
  digitalWrite(pin13,HIGH);
}