arduino internal pull up resistor code example
Example 1: arduino internal pull up resistor
pinMode(2,INPUT_PULLUP);
Example 2: arduino digital input pins
int ledPin = 13;
int inPin = 7;
int val = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(inPin, INPUT);
}
void loop() {
val = digitalRead(inPin);
digitalWrite(ledPin, val);
}
Example 3: arduino internal pull up resistor
Serial.println(sensorValue, DEC);
Example 4: arduino internal pull up resistor
int sensorValue = digitalRead(2);
Example 5: arduino internal pull up resistor
pinMode(13, OUTPUT);
Example 6: arduino internal pull up resistor
Serial.begin(9600);