Arduino Mega 32 Relays Web Server

Hello!
Use this code https://dl.dropboxusercontent.com/u/167251214/iphone_ethernet_sw_mega/iphone_ethernet_sw_mega.ino to control 10 relays via the internet and works well on the arduino mega.
Help me modify the code to order all outputs on the arduino mega?
I tried to do that and I was able to add controls to the web page but the code does not work.
Please help.

Help me modify the code to order all outputs on the arduino mega?

You want me to type for you? What do you want be to type?

I tried to do that and I was able to add controls to the web page but the code does not work.

But, it isn't important to show the new code, to show the resulting web page, or to explain what "it doesn't work" means. Wrong on all three counts.

This is the code modified by me for 15 relays. https://dl.dropboxusercontent.com/u/167251214/iphone_ethernet_sw_mega/iphone_15_relays.ino Work properly only the first 10. Where I'm wrong? :(

How many characters will        char c = client.read();read into the c variable ? Will tests like this work ?

 switch (c) {
    case '10':

I get this error when verifying code https://dl.dropboxusercontent.com/u/167251214/Poze/eror.jpg If remove (case '10 ': case '11': case '12 ': case '13': case '14 ': case '15' ) code only works for the first 10 relays. The other five commands appear in the table but does not work properly

c can only hold a single character, '10' is two characters. It will work if you use numbers instead of characters. You need to read more than one character (if any), store them in a char array, then use functions like atoi to convert the char array to a number, that you will use as an index for the outputAddress array :)

Another crappy solution if you want to use only one characters for your commands, is to convert the received character to it's decimal value, as such:

triggerPin( outputAddress[ c - '0' ], client, outp );

In ASCII, '0' = 48, '1' = 49 etc, so if your c = '0', that is '0' - '0' = 0, the array index will be 0,

'1' - '0' = 1, etc ...

':' - '0' = 10

Sending command ':' would trigger relay 10

http://www.asciitable.com/index/asciifull.gif

Did you read what I wrote in my previous post ?

Look at the line numbers and see where it says the case value was previously used. Something should stand out about the values of c being tested for in the pairs of lines.

There are those who understand what they read. Unfortunately there are those too who read only what they understand. Perhaps it's balance, one +1 for every -1...

A different control setup for servos, but may give some ideas for a similar simple setup. One could send commands like 22H, and capture to a String. Then the captured String could be evaluated for 22 and H or L to set relay 22 to either high or low.

//zoomkat 11-22-12 simple delimited ',' string parse 
//from serial port input (via serial monitor)
//and print result out serial port
//multi servos added 

String readString;
#include <Servo.h> 
Servo myservoa, myservob, myservoc, myservod;  // create servo object to control a servo 

void setup() {
  Serial.begin(9600);

  //myservoa.writeMicroseconds(1500); //set initial servo position if desired

  myservoa.attach(6);  //the pin for the servoa control
  myservob.attach(7);  //the pin for the servob control
  myservoc.attach(8);  //the pin for the servoc control
  myservod.attach(9);  //the pin for the servod control 
  Serial.println("multi-servo-delimit-test-dual-input-11-22-12"); // so I can keep track of what is loaded
}

void loop() {

  //expect single strings like 700a, or 1500c, or 2000d,
  //or like 30c, or 90a, or 180d,
  //or combined like 30c,180b,70a,120d,

  if (Serial.available())  {
    char c = Serial.read();  //gets one byte from serial buffer
    if (c == ',') {
      if (readString.length() >1) {
        Serial.println(readString); //prints string to serial port out

        int n = readString.toInt();  //convert readString into a number

        // auto select appropriate value, copied from someone elses code.
        if(n >= 500)
        {
          Serial.print("writing Microseconds: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.writeMicroseconds(n);
          if(readString.indexOf('b') >0) myservob.writeMicroseconds(n);
          if(readString.indexOf('c') >0) myservoc.writeMicroseconds(n);
          if(readString.indexOf('d') >0) myservod.writeMicroseconds(n);
        }
        else
        {   
          Serial.print("writing Angle: ");
          Serial.println(n);
          if(readString.indexOf('a') >0) myservoa.write(n);
          if(readString.indexOf('b') >0) myservob.write(n);
          if(readString.indexOf('c') >0) myservoc.write(n);
          if(readString.indexOf('d') >0) myservod.write(n);
        }
         readString=""; //clears variable for new input
      }
    }  
    else {     
      readString += c; //makes the string readString
    }
  }
}