Liste des Groupes | Revenir à rc metalworking |
On Wed, 20 Mar 2024 07:47:03 -0000 (UTC), (James Waldby) wrote:[snip]Richard Smith <null@void.com> wrote:"Jim Wilkins" <muratlanne@gmail.com> writes:"Richard Smith" wrote in message news:m1ttl3qahq.fsf@void.com..."Second picture is where commented-out "pinMode(2,
INPUT_PULLUP);". Initially LED lighting randomly when button not
pressed. Then added in the circuit the "pull-up" resistor connected to
on-board supply voltage and the circuit behaved like the first
circuit."
Unconnected inputs are sensitive antennas that pick up secret messages
from space, or noise from fluorescent lights and radio/TV
transmitters. Some even float to a middle level where they partly turn
on both the input high and input low circuits, causing oscillation or
higher power consumption. They are all best made high or low if not
used. [...]
[snip]Setting an open IO to low or high output like that is one approach,
but on the Arduino Uno a simpler / less risky approach is to set
pinMode to INPUT_PULLUP. Note, ATmega328P microcontroller chip
hardware as on an Uno sets all IO pins to INPUT during Reset, but boot
firmware changes the modes of some pins like D0, D1, D13 as per eg
<https://forum.arduino.cc/t/behavior-of-pins-during-reset-state/640285/12>
The arduino instructions say to tie all unused digital inputs either
high or low and all analog inputs low to prevent ambiguous outputs.
Les messages affichés proviennent d'usenet.