Project showcase
Capture and Tweet

Capture and Tweet © MIT

Sometimes i need to take a photo with my friends and then tweet.This project is to make tweeting easy.

  • 939 views
  • 0 comments
  • 8 respects

Components and supplies

Necessary tools and machines

Android Phone

Apps and online services

About this project

Many times i want to take a photo with my friends then (of course) Tweet.This process is annoying to deal with diffrent apps on the same platform (android) so the 1sheeld united all you want form software and hardware togther with one line of code. Actually in my case two lines of code one for capturing and the other for tweeting :D


Code

Untitled fileArduino
/*

Camera Shield Example

This example shows an application on 1Sheeld's camera shield.

By using this example, you can take a photo using your phone's
camera each time you press the hardware push button placed on
pin 12.

OPTIONAL:
To reduce the library compiled size and limit its memory usage, you
can specify which shields you want to include in your sketch by
defining CUSTOM_SETTINGS and the shields respective INCLUDE_ define. 

*/

#define CUSTOM_SETTINGS
#define INCLUDE_CAMERA_SHIELD
#define INCLUDE_TWITTER_SHIELD

/* Include 1Sheeld library. */
#include <OneSheeld.h>

/* A name for the button on pin 12. */
int buttonPin = 12;
/* A name for the LED on pin 13. */
int ledPin = 13;

void setup()
{
  /* Start communication. */
  OneSheeld.begin();
  /* Set the button pin as input. */
  pinMode(buttonPin,INPUT);
  /* Set the LED pin as output. */
  pinMode(ledPin,OUTPUT);
}

void loop()
{
  /* Always check the button state. */
  if(digitalRead(buttonPin) == HIGH)
  {
    /* Turn on the LED. */
    digitalWrite(ledPin,HIGH);
    /* Turn on the camera flash. */
    Camera.setFlash(ON);
    /* Take the picture. */
    Camera.rearCapture();
    /* Wait for 10 seconds. */
    OneSheeld.delay(10000);
    /* Post the picture on Twitter. */
    Twitter.tweetLastPicture("Posted by @1Sheeld");
  }
  else
  {
    /* Turn off the LED. */
    digitalWrite(ledPin,LOW);
  }
    
}
Code
You can change the tweet text to any sh_t you like.

Schematics

circuit
Take%20photo%20and%20tweet.fzz

Comments

Similar projects you might like

Capture Photos with one Click

Project showcase by tesla nerd

  • 3,170 views
  • 0 comments
  • 7 respects

Tweet from Arduino through your smartphone

Project showcase by Amr Saleh

  • 428 views
  • 0 comments
  • 2 respects

Automated Photo Booth using Arduino and 1Sheeld

Project in progress by Ashraf Nabil

  • 3,459 views
  • 0 comments
  • 11 respects

Automated Clothes & Shoes Donation Machine

Project tutorial by Mahmoud Ahmed

  • 2,440 views
  • 3 comments
  • 22 respects

Skype Emergency Call

Project showcase by Manuel Miguel

  • 839 views
  • 0 comments
  • 4 respects

DIY Vending Machine using Arduino & 1Sheeld

Project tutorial by Mahmoud Ahmed

  • 6,961 views
  • 7 comments
  • 32 respects
Add projectSign up / Login