Show Posts
Pages: 1 ... 179 180 [181] 182 183 ... 400
2701  Using Arduino / Project Guidance / Re: ICSP and SPI on: April 18, 2013, 08:14:33 am
And I use the rightmost header?
Yes. The one in the pic marked with "(1) MISO".
2702  Using Arduino / Project Guidance / Re: ICSP and SPI on: April 18, 2013, 07:58:03 am
D11-D13 will be freed up only on the Mega and Leonardo. The Uno still has the SPI data lines mirrored on D11-D13, so if you use the SPI, you can't use those pins on an Uno.
2703  Using Arduino / Project Guidance / Re: ICSP and SPI on: April 18, 2013, 07:46:08 am
So I can simply connect this cable, and keep the pin numbers the same (as in; these are clones of the SPI pins in a standard configuration)?
Or do I need to tell the SPI library to use the 'standard' ISCP header? And would that 'free up' pins 11 to 13?
You do not need to tell the SPI library anything. The SPI data lines are duplicated on the ICSP and the digital pins for each device except the Leonardo. It has the SPI lines only on the ICSP pins.

You must check the pin numbers on that ICSP connector carefully to insure you have the correct pins connected. Connecting two OUTPUT pins together can cause damage, especially if one is HIGH, and the other LOW.
2704  Using Arduino / Project Guidance / Re: ICSP and SPI on: April 18, 2013, 07:20:32 am
Quote
I'm wondering if this is correct. In other words, if the MISO MOSI and CLK pins in (one of) the ICSP header(s) aren't simply 'clones', of a sort, of pins 13 to 11, or can be used for a SPI-interface.
Not only can you use it, but you should. It is the "compatibility patch" for the Uno, Mega, and Leonardo. The newer shields do not use D11-D13. They all use that back ICSP connector now.
2705  Using Arduino / Networking, Protocols, and Devices / Re: Problem with WiFi Shield and Uno R3. Is my shield fried? on: April 18, 2013, 07:16:44 am
That code can lock up if there is a problem with the connection (fail). It happens a lot more often than you think, especially with wireless. Take a look at this code. It has a timeout that prevents the server from locking up.
http://playground.arduino.cc/Code/WebServerST
It is for the ethernet shield, but it should be easy to convert to the Wifi shield. I already helped get the email client code working for the Wifi shield.
http://playground.arduino.cc//Code/WiFiEmailClient

@Thomas33: It's been a while since I communicated with you. I finally got the bug out of the ethernet library.  smiley
http://arduino.cc/forum/index.php/topic,57972.msg513578.html#msg513578

edit: If you want to test the code, I suggest PuTTY. I connect to the shield ip port 80 using RAW mode. When you connect, you will see nothing on either end yet. Type "Gotcha!" on the PuTTY screen and press the enter key only once. If you stay connected with PuTTY, the server locks up. If you remove the CAT5 cable or break the wireless connection at that point, it really does "Gotcha!".

On my code in the playground, it only "Gotcha!" for 10 seconds. Then you are back in business.
2706  Community / Website and Forum / Re: Advanced Searching? on: April 18, 2013, 06:34:03 am
Ah, so there it is.  Somewhere that nobody can find it. 
Only if you did not read reply #2.
2707  Using Arduino / Storage / Re: Interfacing SD card shield to Arduino Uno on: April 18, 2013, 06:17:20 am
Thank you. But I need one more digital pin for a sensor in my project. The sensor is a metal detector. It gives LOW when a metallic object comes near it. Because all 12 digital pins are engaged between SPI interface and a 16*2 LCD display. What can I do? Can I access the analog pins for that?
Yes.
2708  Using Arduino / Networking, Protocols, and Devices / Re: Help me understand this send mail code! Thank you! on: April 17, 2013, 03:32:38 pm
Oh, it gets better than that! Like I said, I get spam mail from me. It is my name and email address as the sender, and the same for the recipient. If you reply to it, you get the reply in your email.  smiley-lol

The server will respond with the appropriate codes. If the mailbox is full or non-existent, you should get a response code of 400 or bigger. That is why the code checks the first character of the response for every send. If it is 4 or larger, it is a fail. 3 or smaller is a pass.
2709  Using Arduino / Networking, Protocols, and Devices / Re: Problem connecting an Ethernetshield Rev3 with an ADK/Mega (and its USB host) on: April 17, 2013, 02:59:59 pm
What cables? You shouldn't need any cables. Remove those green wires. You don't need those either. The SPI data lines (SCK, MISO, and MOSI) are on the ICSP connector for the shield and the Mega. As long as that ICSP is connected, you are good.
2710  Using Arduino / Networking, Protocols, and Devices / Re: Problem connecting an Ethernetshield Rev3 with an ADK/Mega (and its USB host) on: April 17, 2013, 02:45:54 pm
Quote
Should I connect ISCP to the 3.3V or 5V Pin of the Mega?
You can't just plug the ethernet shield into the Mega? Mine fits fine.

The ICSP power is 5v.

If you have a pre-Rev3 Mega, there will be two extra pins on each side of the shield toward the usb connectors. Just insure they do not touch anything on the Mega.
2711  Using Arduino / Networking, Protocols, and Devices / Re: Problem connecting an Ethernetshield Rev3 with an ADK/Mega (and its USB host) on: April 17, 2013, 02:40:32 pm
Quote
Additionally, the bins D11-13) are connected to D50-52 on the Mega
You can remove those jumpers. D11-D13 on the Mega can be used for general I/O, and the ethernet shield has nothing connected there if it has the 6 pin ICSP connector on the bottom of the shield.
2712  Using Arduino / Networking, Protocols, and Devices / Re: Problem connecting an Ethernetshield Rev3 with an ADK/Mega (and its USB host) on: April 17, 2013, 02:25:44 pm
I use an external power suply, but the board has a 3,3V and 5V Jumper. This is set to 3,3V at the moment
I think that is just for your I/O pin voltage, not power supply. But I could be wrong there. My I/O pins are 5v on my Mega.

What is the volt/amp rating on the power supply?

Do you have anything plugged into the usb host? Have you tried the ethernet shield like that?
edit: "like that" meaning nothing plugged into the usb host port. And maybe I misunderstood. Which "board" has the jumper? The power supply? I do not see a power jumper on the Mega ADK. I might be missing it tho.
2713  Using Arduino / Networking, Protocols, and Devices / Re: GET/ requests Headache on: April 17, 2013, 02:06:01 pm
You will have problems if you do not use the code I added above. It has all the stuff that will make your headache go away. Nothing in that code is a waste of memory. It all has a purpose.

The "while(client.available())" loop only reads one packet at a time. So if you do not stay in the "while(client.connected())" loop, you only read the first packet.

The theory is the server will send packets, and when it is finished, it will close the connection. Then you as the client close your end. If this was "perfect world", that would be all you need.

However, this is not "perfect world", this is "real world". Stuff fails here, and if the connection breaks (fails) while waiting for the server response, it will stay in the "while(client.connected())" loop forever. To prevent that, there is a timeout routine that will close the connection if it does not receive a packet for 10 seconds. That is what loopCount does.

You can avoid all the headaches it caused me to get those problems out, or you can figure it out yourself like I did.

edit: Your web server is in "real world". If it failed while the Arduino was waiting for the response, and you had no timeout, that would have been a fail on the Arduino also.
2714  Using Arduino / Networking, Protocols, and Devices / Re: GET/ requests Headache on: April 17, 2013, 01:51:22 pm
@SurferTIM-> I would just try delaying a few seconds after that part you pointed out in the same code I have and then come back to you!
Only if you don't want to take the time to do it right. But then you already have a headache, so what will it matter?  smiley

edit: Here is the right way, in the event you get tired of that headache.
Code:
 while(client.connected())  {
    while(client.available())    {
      inChar = client.read();
      Serial.write(inChar);
      // set connectLoop to zero if a packet arrives
      connectLoop = 0;
    }

    connectLoop++;

    // if more than 10000 milliseconds since the last packet
    if(connectLoop > 10000)    {
      // then close the connection from this end.
      Serial.println();
      Serial.println(F("Timeout"));
      client.stop();
    }
    // this is a delay for the connectLoop timing
    delay(1);
  }

  Serial.println();

  Serial.println(F("disconnecting."));
  // close client end
  client.stop();
2715  Using Arduino / Networking, Protocols, and Devices / Re: Problem connecting an Ethernetshield Rev3 with an ADK/Mega (and its USB host) on: April 17, 2013, 01:46:50 pm
Have you tried it without a SD card in the slot?

The only other thing I can think of is power. How are you powering it? The w5100 is a bit on the hungry side. Is the usb host powering/charging anything?
Quote
NB: Because the ADK is a USB Host, the phone will attempt to draw power from it when it needs to charge. When the ADK is powered over USB, 500mA total is available for the phone and board.The external power regulator can supply up to 1500mA. 750mA is available for the phone and ADK board. An additional 750mA is allocated for any actuators and sensors attached to the board. A power supply must be capable of providing 1.5A to use this much current.
Pages: 1 ... 179 180 [181] 182 183 ... 400