Im currently running a webpage from my arduino mega building from basic web server examples.
My question is im really unsure how much HTML I should be using in each client.pintln() line of code.
Heres an example of one of my lines of code
client.println(F("SMTWTFS"));
As your can see its quite long yet has not problems being sent/received and I have MANY of these.
So my question stands, how long can I make each client.println() command?
And one other question, what is the difference between client.println() and client.println(F()) ?
The Learning section says the F one reads from flash memory however I was under the impression all code uploaded to the arduino is stored in Flash memory? Im confused!
So my question stands, how long can I make each client.println() command?
As long as you want, until it doesn't work. The data is all buffered, so the function will merely block until the data has been buffered.
And one other question, what is the difference between client.println() and client.println(F()) ?
The F() macro generates code to fetch the literal from PROGMEM (flash memory), so the literal is not also stored in SRAM. Without it, the data is copied to SRAM at run time. You don't have a lot of SRAM.
I'm re adding my whole web page to my arduino project after re designing it in a proper html editor and I'm and am trying to work out what size chunks I should cut it up into.....for the client.print()
The bigger chunks I can use the better.
In regards to putting one html tags per client.print....
That would make the program way to big with over 500 html tags as it is.
Debugging is not an issue in this case.
I'm with you. Every call to client.write(), client.print(), or client.println() is sent in a separate packet. The fewer packets sent, the faster and the less chance of a fail. I use a 64 byte buffer when using the SD with the w5100. I read 64 bytes from the SD file into the byte array, then send that as one 64 byte packet.