  
  created 14 March 2012
  by Scott Fitzgerald
+ modified 25 May 2016
+ by bunnie
  
  http://www.arduino.cc/en/Tutorial/InputPullupSerial
  

/*
 Input Pullup Serial
 


void setup(){
  //start serial connection
  Serial.begin(115200);
  //configure A3 as an input and enable the internal pull-up resistor
  pinMode(A3, INPUT_PULLUP);
  pinMode(A2, OUTPUT); 

}

void loop(){
  //read the pushbutton value into a variable
  int sensorVal = digitalRead(A3);
  //print out the value of the pushbutton
  Serial.println(sensorVal);
  
  // Keep in mind the pullup means the pushbutton's
  // logic is inverted. It goes HIGH when it's open,
  // and LOW when it's pressed. Turn on pin A2 when the 
  // button's pressed, and off when it's not:
  if (sensorVal == HIGH) {
    digitalWrite(A2, LOW);
  } 
  else {
    digitalWrite(A2, HIGH);
  }
}

