/*Pull-up resistor test*/
int buttonPin1 = A0;
int buttonPin2 = A3;
int Led1 = 2;
int Led2 = 4;
void setup() {
pinMode(buttonPin1,INPUT);
pinMode(buttonPin2,INPUT);
pinMode(Led1,OUTPUT);
pinMode(Led2,OUTPUT);
Serial.begin(9600);
}
void loop() {
int buttonState = digitalRead(buttonPin1 ); //read the state of the button input
if (buttonState == LOW) { // if the button is pressed it is low state
digitalWrite(Led1,HIGH);
//see flickering led or less bright
} else {
digitalWrite(Led1,LOW);
Serial.println(buttonState);
int buttonState = digitalRead(buttonPin2 ); //read the state of the button input
if (buttonState == LOW) { // if the button is pressed it is low state
digitalWrite(Led2,HIGH);
//see flickering led or less bright
} else {
digitalWrite(Led2,LOW);
Serial.println(buttonState);
}
}
}