arduino pull down resistor code example
Example 1: arduino internal pull up resistor
pinMode(2,INPUT_PULLUP);
Example 2: arduino internal pull up resistor
Serial.println(sensorValue, DEC);
Example 3: arduino internal pull up resistor
int sensorValue = digitalRead(2);
Example 4: arduino pullup
pinMode(pin, INPUT); // set pin to input
digitalWrite(pin, HIGH); // turn on pullup resistors