Hello, I wanted to ask how I could get from a url address of the variables which then went to set the operation of a stepper motor.
I followed guide link: http://idledev.com/2015/04/http-get-parameters-with-arduino-part-1/
In a few words I should get from url (es. 190.168.1.100?val1=10) the number 10 that Arduino will interpret this as a pause time for the start of the stepper
I have already created that generates me the url website lacks only communication through the ethernet shield and import of the variables into the delay ()
Stepper code
#include <Stepper.h>
const int passi_motore = 200; // cambia questo numero in base ai passi che compie il motore
// che hai collegato
// inizializza la libreria con i pin utilizzati da Arduino:
Stepper motore(passi_motore,5,4,3,2);
void setup() {
// imposta la velocità di rotazione a 60 giri al minuto:
motore.setSpeed(60);
// apre la porta seriale di comunicazione:
Serial.begin(9600);
// attiva i motori:
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
}
void loop() {
// compie un giro in una direzione:
Serial.println("clockwise");
motore.step(passi_motore);
delay(500); // ritardo
// compie un giro nella direzione opposta:
Serial.println("counterclockwise");
motore.step(-passi_motore);
delay(500); // ritardo
}