This question already has an answer here:

What is the purpose of it and on what bases its value is calcuated in ohms ?

enter image description here

marked as duplicate by Edgar Bonet, Majenko arduino-uno Aug 20 at 10:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • use INPUT_PULLUP mode for a simpler wireup – dandavis Aug 21 at 17:09

Browse other questions tagged or ask your own question.