RetroFed Forum
Your home away from modern life.
It's always a floating input.
Post Reply
AuthorMessage
MapleEngineer lemmy.ca MapleEngineer@lemmy.ca
Joined: 2023-06-14
Quote

If your circuit is behaving weirdly, switching on when you touch a wire or move your hand over the circuit you almost certainly have a floating input. You can solve this problem with a pull-up resistor. Many AVRs have built-in pull-up resistors that you can turn on using code.

In Sketch:

pinMode(2, INPUT_PULLUP);

In BascomAVR:

Config Portb.1 = Input
Set Portb.1

There's a great article at SparkFun about Pull-up Resistors.

2   Original
Post Reply
Back to top