Real beginner quiestion sorry

Hi. Im new here so thanks in advance.

In the project below. Why is it when i pull out the 10k resistor does the code run in a constant loop? As in the lights never stop flashing.

Is there always power to all the pins when supplied to the board and if so why does draining it down through earth not give the same reaction? If there was power at pin 2 in the beginning there is still power there even with the resistor to earth. No?

Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu.
[code]Paste your sketch here[/code]

Show us a good schematic of your circuit.
Show us a good image of your wiring.
Give links to components.
Posting images:
https://forum.arduino.cc/index.php?topic=519037.0

In the project below.

What project?

Why is it when i pull out the 10k resistor

I don't see any 10K resistor.

Is there always power to all the pins when supplied to the board

No. Pins are, by default, input pins.

This is the code im copying

monkeywars:
In the project below. Why is it when i pull out the 10k resistor does the code run in a constant loop? As in the lights never stop flashing.

Because an unconnected input pin floats in voltage, picking up all manner of signal from the nearby environment,
never have a floating input pin like that. Thus the 10k pull-down so the pin's voltage is always well defined.

MarkT:
Because an unconnected input pin floats in voltage, picking up all manner of signal from the nearby environment,
never have a floating input pin like that. Thus the 10k pull-down so the pin's voltage is always well defined.

So its basically just picking up noise and interferance and identifying it as input voltage?

So its basically just picking up noise and interference and identifying it as input voltage?

Yes, that's correct.

To clarify something, there is no such thing as no voltage (not to be confused with zero volts, 0V, sometime stated as "no volts"). Everything made of normal matter has a voltage, which includes an input pin on a micro-controller that is not connected to anything. The question becomes one of what that voltage is. If you connect the pin to something, perhaps a resistor to 0V or Vcc then you make the voltage what you want it to be, if you leave it unconnected then the voltage can be any old thing from the environment, but still, most definitely, a voltage.

Please, monkeywars,

Before you do anything else please take a moment to read General guidance and
How to use this forum
Especially item #7 on posting code.

Also How to post an image

Thank you.

And (adding to Reply #7) please don't post pictures of code. Just post the code as text using the code button </>

...R

PS ... don't apologise for being a beginner. We like beginners.

Ok thanks. I didnt think it would be that sensitive. That clears alot up and ill have a look at the posting rules