move a stepper by pressing button html

Hello i'm having some problems i'm trying to move my stepper with an html portal but what i try to do it wont seem to work does any one have a suggestion?

#include <SPI.h>
#include <Ethernet.h>
#include <AccelStepper.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
IPAddress ip(192,168,163,253);
IPAddress gateway(192,168,163, 99);
IPAddress subnet(255, 255, 255, 0);
EthernetServer server(80);                                      //server port
String readString; 

#define FULLSTEP 4
#define HALFSTEP 8

//declare variables for the motor pins
int motorPin1 = 10;	// Blue   - 28BYJ48 pin 1
int motorPin2 = 11;	// Pink   - 28BYJ48 pin 2
int motorPin3 = 12;	// Yellow - 28BYJ48 pin 30
int motorPin4 = 13;	// Orange - 28BYJ48 pin 4
                        // Red    - 28BYJ48 pin 5 (VCC)

// The sequence 1-3-2-4 required for proper sequencing of 28BYJ48
AccelStepper stepper2(FULLSTEP, motorPin1, motorPin3, motorPin2, motorPin4);

void setup() {
// Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
  //setup for stepper motor 
  stepper2.setMaxSpeed(1000.0);
  stepper2.setAcceleration(50.0);
  stepper2.setSpeed(200);
  stepper2.moveTo(2048);
}


void loop() {
  // Create a client connection
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {   
      if (client.available()) {
        char c = client.read();
     
        //read char by char HTTP request
        if (readString.length() < 100) {
          //store characters to string
          readString += c;
          //Serial.print(c);
         }

         //if HTTP request has ended
         if (c == '\n') {          
           Serial.println(readString); //print to serial monitor for debuging
     
           client.println("HTTP/1.1 200 OK"); //send new page
           client.println("Content-Type: text/html");
           client.println();     
           client.println("<HTML>");
           client.println("<HEAD>");
           client.println("</HEAD>");
           client.println("<BODY>");
           client.println("<H1>Control Center</H1>");
           client.println("
");  
           client.println("<a href=\"/?button1\"\">Move Stepper Clockwise</a>");
           client.println("
"); 
           client.println("<a href=\"/?button2\"\">Move Stepper</a>
"); 
           client.println("
"); 
           client.println("</BODY>");
           client.println("</HTML>");
           
           delay(1);
           //stopping client
           client.stop();
           //controls the Arduino if you press the buttons
           if (readString.indexOf("?button1") >0){
              stepper2.moveTo(2048);
              stepper2.run(); 
                {
                  delay(15);                       // waits 15ms
                } 
           }
           if (readString.indexOf("?button2") >0){
 if (stepper2.distanceToGo() == 0)
      stepper2.moveTo(-stepper2.currentPosition());
    stepper2.run();
           }
            //clearing string for next read
            readString="";  
           
         }
       }
    }
}
}

Can you get the stepper to move correctly by sending characters from the Arduino Serial Monitor (i.e. without using any Ethernet stuff)?

Can your Arduino correctly receive characters via the Ethernet connection (i.e. without bothering with any stepper motor stuff)?

...R

int motorPin1 = 10;	// Blue   - 28BYJ48 pin 1
int motorPin2 = 11;	// Pink   - 28BYJ48 pin 2
int motorPin3 = 12;	// Yellow - 28BYJ48 pin 30
int motorPin4 = 13;	// Orange - 28BYJ48 pin 4

Those are the SPI pins that the Arduino and Ethernet shield use to communicate. You can NOT use them for your motor.

thanks changed the pin now it does a little more. the led on the connector controller change but motor doesnt run yet

is i run it without html like this it will run

// accellsteppertest.ino
// Runs one stepper forwards and backwards, accelerating and decelerating
// at the limits. Derived from example code by Mike McCauley
// Set for 28BYJ-48 stepper

#include <AccelStepper.h>

#define FULLSTEP 4
#define HALFSTEP 8

//declare variables for the motor pins
int motorPin1 = 8;	// Blue   - 28BYJ48 pin 1
int motorPin2 = 9;	// Pink   - 28BYJ48 pin 2
int motorPin3 = 10;	// Yellow - 28BYJ48 pin 30
int motorPin4 = 11;	// Orange - 28BYJ48 pin 4
                        // Red    - 28BYJ48 pin 5 (VCC)

// The sequence 1-3-2-4 required for proper sequencing of 28BYJ48
AccelStepper stepper2(FULLSTEP, motorPin1, motorPin3, motorPin2, motorPin4);

void setup()
{    
  stepper2.setMaxSpeed(1000.0);
  stepper2.setAcceleration(50.0);
  stepper2.setSpeed(200);
  stepper2.moveTo(2048);
}

void loop()
{
  //Change direction at the limits
  stepper2.moveTo(2048);
  stepper2.run();
}

if i look at the monitor it gets the press button command

server is at 192.168.163.253
GET /?button2 HTTP/1.1
GET /?button1 HTTP/1.1

The next step is to extend the servo code (still without the HTML stuff) to include a variable that holds the sort of value that will come from the web and use the value in that variable to get the motor to do different things. For example if the value is 2 the motor will rotate one way. If you change the value to 1 and upload the revised sketch the motor will rotate the other way.

When that works (and only then) you can combine the codes so that the HTML stuff puts its value into the variable rather than you.

...R

int motorPin3 = 10;	// Yellow - 28BYJ48 pin 30
int motorPin4 = 11;	// Orange - 28BYJ48 pin 4

Is there some part of "You can't use pins 10, 11, 12, OR 13" for your motors that you don't understand?

On the Uno pins 10..13 are hardware SPI, but on the Mega its a different set - have
we established which Arduino is involved??

my bad i'll change it to 6,7,8,9 i'll try again next week. i've got a UNO Rev. 3 with Ethernetshield rev 3 and Tinker-shield Tinker-shield