How does Arduino actually turn on an LED? (The raw truth inside the chip)

hello again! you are my friend!:grinning_face:

my message from bellow translated with ai:

I use pin 13 because it is the onboard LED and it already has a built-in resistor! You don't need an external LED or resistor. For learning purposes, you can even connect a LED directly to a pin without a resistor; 90% of the time, nothing bad will happen if you use just one port and one LED. Problems only appear when you use multiple LEDs and multiple pins without series resistors. [1, 2, 3, 4, 5]

Anyway, I highly recommend starting with the Arduino Nano because it is so cheap. For learning, buying 10 pieces is actually a great idea! If one breaks, you just swap it for another. If you are constantly afraid of breaking things, you will never learn! [1]

So, if you write digitalWrite(13, HIGH); in the Arduino IDE, or sbi 5, 5 in my program, without setting the pin as an output, the LED shines faint. But if you also add sbi 4, 5, the LED shines bright.

my original message:

i use 13 because is led onboard and already ha ve a resistor onboard! not need external led and resistor! Also you can put directly led on pin without resistor as didactic, in 90% of cases not suceed nothing if use only a port and only a led , problems appear when use more led and more pins without serial resistor. Anyway raccomand begin with arduino nano because cost is less , and for learn , buy 10 pieces , is not abad idea! when one not working change with another.because if you are fear to brocken ,not learn ever!

so if in arduino ide write digitalwrite(13,HIGH) or in my program sbi 5,5 without set pin as output the led faint, is put also sbi 4,5 led bright