Resistor in button setup

Hi. I'm fairly new to electronics and arduino and I was looking at this tutorial where they connect a resistor on the ground line. The tutorial doesn't explain why they do that and doesn't specify how they came to the decision to use a 10Kohm resistor. It might just be a simple detail but I'm curious and wondering if someone here would be kind enough to explain it to me :slight_smile:

A resistor connected to ground line on input pin is called pull-down resistor, and is used to let the input stable and not floating. Similar configuration can b used with a resistor to positive, called pull-up resistor. With Arduino this is a preferred configuration, since you can use the built-in one (see pinMode() reference. Here the wikipedia page that explain the concept better than me.

Ciao, Ale.

This tells you.

The value is a compromise between using current and being immune from interface.