I was following up the steps in this tutorial :
Although everything is ok, I don't want to control my Arduino Mega through a web page. I want to control my Arduino using Python (honestly, controling Arduino is a part of a bigger Python software).
When I press on the 'light on' button on the web page, the LED immediately turns on. However, when I use urllib2 library in Python to request the same URL
("http://192.168.1.177/?lighton"), it takes about 1 second (actually crucial one second to my project) to turn on !
I don't understand why this happens !
the Python code I use is very simple :
import urllib2 urllib2.urlopen("http://192.168.1.177/?lighton") urllib2.urlopen("http://192.168.1.177/?lightoff") #after the LED turns on
I hope someone can help me