Go Down

Topic: Ethernet to wifi help (Read 391 times) previous topic - next topic

chucky23

Code: [Select]
#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.

pitusso

Hi,
you can look at here:
https://github.com/OfficineArduino/arduinotour/blob/master/examples/postTweet/postTweet.ino

chucky23

thanks for the help, but i tried and it states that "error compiling"
how can i correct that?

PaulS

Quote
how can i correct that?

Remove the problems.

chucky23

thanks alot, I've removed the problems now

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy