#if defined(ARDUINO) && ARDUINO > 18 // Arduino 0019 or later
#include <SPI.h>
#endif
#include <Ethernet.h>
//#include <EthernetDNS.h> Only needed in Arduino 0022 or earlier
#include <Twitter.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };
Twitter twitter("<<< your token here >>>");
char msg[] = "Hello, World! I'm Arduino!";
void setup()
{
delay(1000);
Ethernet.begin(mac, ip);
Serial.begin(9600);
Serial.println("connecting ...");
if (twitter.post(msg)) {
int status = twitter.wait();
if (status == 200) {
Serial.println("OK.");
} else {
Serial.print("failed : code ");
Serial.println(status);
}
} else {
Serial.println("connection failed.");
}
}
void loop()
{
}
I wanted to use wifi shield rather than Ethernet shield. this works using Ethernet shield but i need help in transforming this code to be used in wifi shield.
any help would be greatly appreciated.