Ethernet Switch (case) Problem

Kam nun auf folgende Idee:

         //read user input
        char c = client.read();
        
          if(c == '*'){

          printHtmlHeader(client); //call for html header and css
          printLoginTitle(client);
          printHtmlFooter(client);
          //sentHeader = true;
          break;
        }
        
        if(!sentHeader){
          
            printHtmlHeader(client); //call for html header and css
            printHtmlButtonTitle(client); //print the button title
            
          //This is for the arduino to construct the page on the fly. 
          sentHeader = true;
        }

        //read user input
    //    char c = client.read();

        //if there was reading but is blank there was no reading
        if(reading && c == ' '){
          reading = false;
        }

        //if there is a ? there was user input
        if(c == '?') {
          reading = true; //found the ?, begin reading the info
        }

       // if there was user input switch the relevant output
        if(reading){
          
          //if user input is H set output to 1
          if(c == 'H') {
            outp = 1;
          }
          
          //if user input is L set output to 0
          if(c == 'L') {
            outp = 0;
          }
          
          Serial.print(c);   //print the value of c to serial communication
          //Serial.print(outp);
          //Serial.print('\n');

          
        char c = client.read();
        Serial.print("c ist ");
        Serial.print(c);
        
        char d = client.read();
        Serial.print("d ist ");
        Serial.print(d);
        
        int cd = c + d;
        Serial.print("cd ist ");
        Serial.print(cd);
        
        
          switch (cd) {

             case '0':
               //add code here to trigger on 0
               triggerPin(outputAddress[0], client, outp);
               break;            
             case '1':
            //add code here to trigger on 1
               triggerPin(outputAddress[1], client, outp);
               break;             
             case '2':
               //add code here to trigger on 2
               triggerPin(outputAddress[2], client, outp);
               break;
             case '3':
               //add code here to trigger on 3
               triggerPin(outputAddress[3], client, outp);
               break;
             case '4':
               //add code here to trigger on 4
               triggerPin(outputAddress[4], client, outp);
               break;
             case '5':
               //add code here to trigger on 5
               triggerPin(outputAddress[5], client, outp);
               //printHtml(client);
               break;
             case '6':
               //add code here to trigger on 6
               triggerPin(outputAddress[6], client, outp);
               break;
             case '7':
               //add code here to trigger on 7
               triggerPin(outputAddress[7], client, outp);
               break;
             case '8':
               //add code here to trigger on 8
               triggerPin(outputAddress[8], client, outp);
               break;
             case '9':
               //add code here to trigger on 9
               triggerPin(outputAddress[9], client, outp);
               break;
             case '10':
               //add code here to trigger on 10
               triggerPin(outputAddress[10], client, outp);
               break;
                 case '11':
               //add code here to trigger on 11
               triggerPin(outputAddress[11], client, outp);
               break;
                case '12':
               //add code here to trigger on 12
               triggerPin(outputAddress[12], client, outp);
               break;
          } //end of switch case

        }//end of switch switch the relevant output 

        //if user input was blank
        if (c == '\n' && currentLineIsBlank){
          printLastCommandOnce = true;
          printButtonMenuOnce = true;
          triggerPin(777, client, outp); //Call to read input and print menu. 777 is used not to update any outputs
          break;
        }

Hab nur grade keinen Arduino zum testen, nachdem ich es geschafft habe, dass meiner vom PC nichtmehr erkannt wird... Wie auch immer ich das geschafft habe...

Kann mir jemand sagen ob der Code so funktioniert, bis mein neuer Mega mit der Post da ist? :smiley: