Improve Arduino WiFly latency using protol
I have an Arduino with a WiFly shield, everyt开发者_开发百科hing works perfectly! The thing is, when I want to turn on an LED, I open in my webbrowser:
192.168.1.120/ledon/
(I made a program which handles this URL).
But the thing is; when I make a request, I must wait 1-2 seconds before I can do another one. So, it is very long, and if I want to control motors, it is just too long.
So, instead of using an HTTP request, I want to use something else which can be faster. Something "super fast". I just need to tell the Arduino: - go direction 1 - go direction 2... - turn on LED - turn off LED - tell me the light level (which return a int)
So it is just about a small amount of data.
Can you show me a way? (Telnet, UDP, OSC?)
For your arduino, have a look at just using sockets or even encoding the data in the URL requested. You shouldnt get less than about 0.8 Seconds Lag maximum. How big is your program for handling the Url /ledon/ ? Using pure packets (usually TCP) from your computer to the arduino is faster sometimes.. But you may need to code a application to handle the packets on the pc. There is the option of Javascript to parse data back and forth e.g. reading the light level and such.
精彩评论