i haver a virtual server domain and a arduino mega with a ethernet shield.
I managed to configure the arduino to send get data through the web server and save them in a txt file.
Once I have the data on the server I made a website in php that collects data from the txt file and then using javascript and buttons change the variables.
Now I have a problem. How do I send data to the arduino ?
I think it would be using the post method from javascript but this is possible ? As I pick up on arduino ?
I'm stuck now
ok its true! I can create a string in php. Write with echo and read with arduino. It is ok?
But the arduino are read all time.
but is there any way to tell the arduino to read at a given time and save processing cycles and keep on arduino read continuously
Thank you
But the arduino are read all time.
but is there any way to tell the arduino to read at a given time and save processing cycles and keep on arduino read continuously
Thank you
I dont know that I true understand, but maybe something like this
long lastMillis = 0;
long loops = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
long currentMillis = millis();
loops++;
/* By doing complex math, reading sensors, using the "delay" function,
* etc you will increase the time required to finish the loop,
* which will decrease the number of loops per second.
*/
if(currentMillis - lastMillis > 1000){
Serial.print("Loops last second:");
Serial.println(loops);
lastMillis = currentMillis;
loops = 0;
}
}