Editing LED
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 8: | Line 8: | ||
A LED typically requires a resistor that is in series with the LED to restrict the current that is flowing through the LED. | A LED typically requires a resistor that is in series with the LED to restrict the current that is flowing through the LED. | ||
− | For sketching we can just use the following values | + | For an LED we are interested in the following parameters: |
+ | * the forward voltage (typically about 2V) | ||
+ | * the forward current (typically about 20mA = 0,02A) | ||
+ | |||
+ | We use the equations R=U/I and U=U1+U2 to calculate the resistor required. | ||
+ | |||
+ | For sketching a shortcut we can also just use the following values: | ||
* 100 Ohm for a controller with 3.3V (our ESP32/ESP8266) | * 100 Ohm for a controller with 3.3V (our ESP32/ESP8266) | ||
− | * | + | * 330 Ohm for a controller with 5V |
= How to connect it electrically = | = How to connect it electrically = | ||
− | + | [[File:Led01.JPG]] | |
− | [[File: | + | LED will be on if Pin is 3.3V (or ON or High) |
+ | [[File:Led02.JPG|frame|200px]] | ||
− | + | LED will be on if Pin is 0V (or OFF or Low) | |
− | LED will be on if | + | [[File:Led03.JPG|thumb|200px]] |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[File:Led03. | ||
= How to control it in MicroPython = | = How to control it in MicroPython = | ||
Line 54: | Line 54: | ||
sleep(0.5) | sleep(0.5) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |