I sending from my android chars to the arduino mega using wifi shield but there is a big delay of receiving those chars like 7 seconds between char to char.
How can I fix it?
sagy.ino (5.83 KB)
I sending from my android chars to the arduino mega using wifi shield but there is a big delay of receiving those chars like 7 seconds between char to char.
How can I fix it?
sagy.ino (5.83 KB)
I am surprised that it works at all.
In loop() you declare the char variable recv then set it equal to the variable returned by recv_request(). Sounds OK so far, but in recv_request() you declare another (local) variable also called recv. This variable is then set to whatever client.read() returns and is itself returned from the function. I don't know about the compiler but I am confused as to which version of the recv variable will be seen by the calling program.
There is another anomaly with the States() function. The recv char is passed to it but the switch/case uses integers as its case variable. '0' is not the same as 0.
About the State(CS), if I use '0' I get nothing.
About recv_request(), you think that if I change the local variable name the delay will decrease?
I don't see ant connection between the variable name to the long delay I have.
I don't see ant connection between the variable name to the long delay I have.
Neither do I, but you should not have 2 variables with the same name so eliminating the problem would be a wise move.