why?In my code can not serial.println data field?

#include <SPI.h>
#include <Ethernet.h>
#define rotary_sensor A0
#define adc_ref 5
#define vcc 5
#define f_angle 300
int input ; 
int test;
int val;
char inbyte;
bool ras=true;
int val1;
int led=13;
int apin=3;
char inbyte1;
bool mts=true;
byte mac[] = {
 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x7D
};
// fill in an available IP address on your network here,
// for manual configuration:
IPAddress ip(192, 168, 12, 184);

// fill in your Domain Name Server address here:


// initialize the library instance:
EthernetClient client;

char server[] = "192.168.12.133";
//IPAddress server(64,131,82,241);

unsigned long lastConnectionTime = 0; 

// last time you connected to the server, in milliseconds
const unsigned long postingInterval = 10L *  1000L; // delay between updates, in milliseconds
const unsigned long postingInterval1 = 10L * 1000L;
void setup() {
   Serial.begin(9600);
 while (!Serial) {
   ; // wait for serial port to connect. Needed for native USB port only
 }

 // give the ethernet module time to boot up:
 delay(1000);
 // start the Ethernet connection using a fixed IP address and DNS server:
 Ethernet.begin(mac, ip);
 // print the Ethernet board/shield's IP address:
 Serial.print("My IP address: ");
 Serial.println(Ethernet.localIP());
 //pinMode(buttonpin, INPUT);
 //pinMode(Led, OUTPUT);
 Serial.begin(9600);
   
   
   pinMode(rotary_sensor,NULL);
   pinMode(apin,NULL);
   Serial.begin(9600);
   pinsInit();
   if(analogRead(rotary_sensor)==4){Serial.println(rotary_sensor);}
   if(digitalRead(apin)==LOW){Serial.println(apin);}
}

/* the loop() method runs over and over again */

void loop() {   
 //if(ras==true || mts==true){
 test = digitalRead(apin);
 if(test==HIGH)//
    {
     digitalWrite(led,HIGH);//
     delay(1000);
     Serial.println("no touch");
     }
 if(test==LOW){
     digitalWrite(led,LOW);
     delay(1000);
     Serial.println("touch"); 
      }
 rotation();
 int degrees;
 degrees = getDegree();
 
 //}else{ras=false;}  
 
 
 if(Serial.available()>0){
   inbyte = Serial.read();
   switch (inbyte){
     case '0':
     input=NULL;
     ras=false;
     Serial.println("Off");
     break;
     
     case '1':
     input=3;
     ras=true;
     Serial.println("On");
     break;
   }
  }
  if(Serial.available()>0){
   inbyte = Serial.read();
   switch (inbyte1){
     case '0':
     apin=NULL;
     mts=false;
     Serial.println("Off");
     break;
     
     case '1':
     apin=3;
     mts=true;
     Serial.println("On");
     break;
   }
  }
 //Serial.println("The angle between the mark and the starting position:");
 //Serial.println(degrees);
 
}
void pinsInit()
{
pinMode(rotary_sensor,input);
}

int getDegree()
{
 int sensor_value = analogRead(rotary_sensor);
 float voltage;
 voltage = (float)sensor_value*adc_ref/1023;
 float degrees = (voltage*f_angle)/vcc;
 Serial.println(degrees);
 return degrees;
 
}  
void touch(){
 client.stop();

 // if there's a successful connection:
 if (client.connect(server, 80)) {
   Serial.println("connecting...");
   // send the HTTP GET request:
 test = digitalRead(apin);
 if(test==HIGH)//
    {
     digitalWrite(led,HIGH);//
     delay(1000);
     Serial.println("no touch");
     }
 if(test==LOW){
     digitalWrite(led,LOW);
     delay(1000);
     Serial.println("touch"); 
      }
   //Serial.println(val);
   if (val==1) {
     client.println("GET /ds/MTS/addMTSData?isTouch=false HTTP/1.1");
   }
   else if (val==0) {
     client.println("GET /ds/MTS/addMTSData?isTouch=true HTTP/1.1");
   }
   client.println("Host: www.arduino.cc");
   client.println("User-Agent: arduino-ethernet");
   client.println("Connection: close");
   client.println();

   // note the time that the connection was made:
   lastConnectionTime = millis();
 } else {
   // if you couldn't make a connection:
   Serial.println("connection failed");
 }
} 
void rotation(){
 
 client.stop();

 // if there's a successful connection:
 if (client.connect(server, 80)) {
   Serial.println("connecting...");
   // send the HTTP GET request:
   
   int sensor_value = analogRead(rotary_sensor);
   float voltage;
   voltage = (float)sensor_value * adc_ref / 1000;
   int degrees = (voltage * f_angle) / vcc;
   {client.println("GET /ds/Lock/addLockData?LID=true HTTP/1.1");}
   client.println("Host: www.arduino.cc");
   client.println("User-Agent: arduino-ethernet");
   client.println("Connection: close");
   client.println();
 
 }  
 
 
 }

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

in this case,i cant to see client.println of data field?what's happen?

and two if statement not equals if else?how to explain?

You need to read how to post code properly, and then edit the OP and put code tags around the code so that it is easy to read and easy to copy and paste.

Pete

i use arduino uno.

Your code does not print the message 'The angle ...' (because you commented it out).

And which data field are you talking about? You do a GET request and happily ignore any data.

I suspect that you have a memory problem, but can't pinpoint it. Where does the 'H' in 'Hconnecting...' come from? What I would do in a situation like this is start from scratch.

int test;
const int apin = 3;
void setup()
{
  Serial.begin(9600);
  pinMode(apin, INPUT);

}

void loop() {
  test = digitalRead(apin);
  if (test == HIGH) //
  {
    digitalWrite(led, HIGH); //
    delay(1000);
    Serial.println("no touch");
  }
  if (test == LOW) {
    digitalWrite(led, LOW);
    delay(1000);
    Serial.println("touch");
  }

Does this work?

Some notes on your current code

pinMode(apin, NULL);

Although this does work because NULL equals 0 equals INPUT, it's a lot clearer of you just use INPUT instead of NULL.

  pinMode(rotary_sensor, input);

'input' is a variable; you're lucky that the initial value in this case is 0 and hence INPUT; use capital INPUT instead. But as you're using analogRead, you do not have to use pinMode.

  if (Serial.available() > 0) {
    inbyte = Serial.read();
    switch (inbyte) {
      ...
      ...
    }
  }
  if (Serial.available() > 0) {
    inbyte = Serial.read();
    switch (inbyte1) {
      ...
      ...
    }
  }

I'm not quite sure what you expect this to do. In theory it will read two sequential bytes. In practive, there might only be one byte available at that time and the second available() will return 0. Next iteration of loop the second byte is available but it will be used by the first 'if' and not the second one. I suggest that you read Serial Input Basics - updated

        input = NULL;

Again, it will work. But looking at just this line, a more experienced programmer will assume that input is a pointer. Use 0 if you mean zero.