3 Different ways to control led with arduino - Arduino IDE Tutorial

Опубликовано: 12 Март 2026
на канале: Dark ink electronics
107
3

0:00 Start
1:01 how to use terminal to debug your code
1:45 sending code to my arduino uno
2:06 built in led test
2:21 controlling an external led
3:03 external led test
3:14 finding the right COM or PORT
3:52 controlling external led with serial monitor
6:13 testing external led with serial monitor
7:00 fixing small problems
8:59 End

in case you don't have a led, replace the word ' led " in my code with " LED_BUITIN " so you can control the builtin led in arduino.

don't plug your led directly to arduino.
it my be burn if the led connot resist to 5 V.
because "digitalWrite" output voltage is 5 V.
you can lower it using resistance and ohm low:
Voltage = resistance * current. arduino current is 0.2 A and the voltage is 5V

advance way to lower the output voltage is to use " analogWrite(led,voltageInDecimal);
arduino has a builtin ANC(Analog to Digital Converter) of 2^10, 10 bits
the maximal value that digital write can reach is 1024 which means 5V.
using the formula : Dout= (2^10 * VoltageWeWant) / Vref
Vref in arduino is 5V.
3 Volt in dicemal:
Dout = (1024 * 3V ) / 5 V ~= 614 is the refence digital number of 3V .
so, you will write in your code "analogWrite(led, 614);" and you should use an analogic pin not the digital one.

like, share , subscribe

Follow me on :

Electronics Channel :    / @dark_ink_electronics  
Music Channel :    / @kzbeats_0  
twitter :   / darkpinkp  
soundcloud :   / user-163169075  


#DarkPink_Electronics #electronics #programming #arduino #led #c #c++