Final Project: Twitter’s Black box

For my thesis project, I am arguing how digital Social Media became a religion (this is like the link to the page), so my idea for pcomp was to create a confessional that you speak to and confess about u digital life within 140 characters and the confessional goes on twitter under my account that I created for my religion.

I managed to get twitter to work with a wifi-shield (though the process was annoying). I had to use an LED to know when its posting on twitter because I can’t use the serial monitor if its wireless. since on twitter you can’t duplicate posts, I had to do an array with different posts. the code is like this:

#include <SPI.h> // needed in Arduino 0019 or later
#include <WiFi.h>
#include <Twitter.h>
int i;

int led = 13;
char ssid[] = “nadine”; // your network SSID (name)
char pass[] = “greenbooger”; // your network password
char messages[][100] = {“Like me”,”retweet me”,”friend me”,”give me attention”,”like my selfie”,”like my picture”,”follow me”};
int count = 7;
// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter(“2900114345-s3F3KJ9dFIas3k6RiTwVOcScDX1cUghOHHKnOXW”);

// Message to post
//char msg[] = “#sam”;

void setup()
{
pinMode(A2,INPUT); //SIG of the Parallax Sound Impact Sensor connected to Digital Pin 7
pinMode(led, OUTPUT);

delay(1000);
WiFi.begin(ssid, pass);
// or you can use DHCP for automatic IP address configuration.
// WiFi.begin(mac);
delay(10000);
Serial.begin(9600);
randomSeed(analogRead(A0));

// Serial.println(“connecting …”);
// if (twitter.post(msg)) {
// // Specify &Serial to output received response to Serial.
// // If no output is required, you can just omit the argument, e.g.
// // int status = twitter.wait();
// int status = twitter.wait(&Serial);
// if (status == 200) {
// Serial.println(“OK.”);
// } else {
// Serial.print(“failed : code “);
// Serial.println(status);
// }
// } else {
// Serial.println(“connection failed.”);
}

void loop(){
boolean soundstate = digitalRead(A2);

if (soundstate == 1) {

analogWrite(led, 255);
Serial.println(“connecting …”);
int i=0;
int num = random(0,count);
if (twitter.post(messages[num])) {
Serial.println(num);
// Specify &Serial to output received response to Serial.
// If no output is required, you can just omit the argument, e.g.
// int status = twitter.wait();
int status = twitter.wait(&Serial);

if (status == 200) {
Serial.println(“OK.”);

} else {
Serial.print(“failed : code “);
Serial.println(status);
}

analogWrite(led, 0);
} // analogWrite(led,0);

delay(2000);

}else{
// servoMain.writeMicroseconds(0);// delay(13000); // Wait 1 second
analogWrite(led,0);
Serial.println(“no tweets!”);
}

}

My next steps for the project to get the speech to text work so the user can confess and the confession can go on twitter.FullSizeRender (5)

FullSizeRender (3)  FullSizeRender (1) FullSizeRender (4)FullSizeRender

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s