Enabling the internal pull-up resistors on an ATmega8
I was having a problem setting up my atmega8 for user input. My input signal from my button (which was directly connected from my microcontroller to ground) seemed to flucuate after a change. It seems that the problem was that the ATmega8’s internal pull-up resistors weren’t enabled (these resistors cause the input signals to default to 1 when connected to nothing in particular). Figuring out how to enable these pullup resistors took a bit of doing. I found what I needed by looking at this