resistor used in input pin of arduino code example
Example 1: arduino internal pull up resistor
int sensorValue = digitalRead(2);
Example 2: arduino internal pull up resistor
pinMode(13, OUTPUT);
int sensorValue = digitalRead(2);
pinMode(13, OUTPUT);