Kütüphanede tanımlanan CS pininin 10 olarak değiştirilmemesi Arduino'nun ethernet modülü ile bağlantı kuramamasına neden olacaktır. "EtherCard.h" dosyasındaki "csPin" değişkenini 10 olarak ayarlamayı unutmayınız. Bu değişikliği nasıl yapabilirim yardımcı olurmusunuz #Arduino

BeğenFavori PaylaşYorum yap
  • Türker Sezer @dirigeant

    EtherCard.h dosyasini bir metin editoriyle acin, csPin degerinin tanimlandigi satiri bulup karsisindaki degeri 10 olarak degistirin. Kutuphaneyi belgelerindeki komutlari kullanarak tekrar derleyin.

    • Selami61 @selami61

      onuda değiştirdim olmadı müsaitseniz teamviewer den yardımcı olurmusunuz

    • Selami61 @selami61

      // Twitter client sketch for ENC28J60 based Ethernet Shield. Uses
      // arduino-tweet.appspot.com as a OAuth gateway.
      // Step by step instructions:
      //
      // 1. Get a oauth token:
      // http://arduino-tweet.appspot.com/oauth/twitter/login
      // 2. Put the token value in the TOKEN define below
      // 3. Run the sketch!
      //
      // WARNING: Don't send more than 1 tweet per minute!
      // WARNING: This example uses insecure HTTP and not HTTPS.
      // The API key will be sent over the wire in plain text.
      // NOTE: Twitter rejects tweets with identical content as dupes (returns 403)
      //
      // License: GPLv2

      #include

      // OAUTH key from http://arduino-tweet.appspot.com/
      #define TOKEN "Insert-your-token-here"

      // ethernet interface mac address, must be unique on the LAN
      byte mymac[] = { 0x00,0xFF,0xDC,0x7A,0x55,0x9C };

      const char website[] PROGMEM = "2346581264-H0qQ7jHFpZodFmudJzzPUPEftd2oHWmi9OqnZcp";

      static byte session;

      byte Ethernet::buffer[700];
      Stash stash;

      static void sendToTwitter () {
      Serial.println("Sending tweet...");
      byte sd = stash.create();

      const char tweet[] = "trdgvjbhjkj";
      stash.print("token=");
      stash.print(TOKEN);
      stash.print("&status=");
      stash.println(tweet);
      stash.save();
      int stash_size = stash.size();

      // Compose the http POST request, taking the headers below and appending
      // previously created stash in the sd holder.
      Stash::prepare(PSTR("POST http://$F/update HTTP/1.0" "\r\n"
      "Host: $F" "\r\n"
      "Content-Length: $D" "\r\n"
      "\r\n"
      "$H"),
      website, website, stash_size, sd);

      // send the packet - this also releases all stash buffers once done
      // Save the session ID so we can watch for it in the main loop.
      session = ether.tcpSend();
      }

      void setup () {
      Serial.begin(57600);
      Serial.println("\n[Twitter Client]");

      // Change 'SS' to your Slave Select pin, if you arn't using the default pin
      if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
      Serial.println(F("Failed to access Ethernet controller"));
      if (!ether.dhcpSetup())
      Serial.println(F("DHCP failed"));

      ether.printIp("IP: ", ether.myip);
      ether.printIp("GW: ", ether.gwip);
      ether.printIp("DNS: ", ether.dnsip);

      if (!ether.dnsLookup(website))
      Serial.println(F("DNS failed"));

      ether.printIp("SRV: ", ether.hisip);

      sendToTwitter();
      }

      void loop () {
      ether.packetLoop(ether.packetReceive());

      const char* reply = ether.tcpReply(session);
      if (reply != 0) {
      Serial.println("Got a response!");
      Serial.println(reply);
      }
      }