mirror of
https://github.com/diodeinc/pcb.git
synced 2026-09-14 20:17:19 +08:00
b3d193e07d
* Fix stdlib style warnings * Fix formatting, lints * Update snapshot
19 lines
545 B
Python
19 lines
545 B
Python
"""
|
|
A simple LED circuit with current limiting resistor.
|
|
This demonstrates using standard components to create a basic LED driver.
|
|
"""
|
|
|
|
Resistor = Module("@stdlib/generics/Resistor.zen")
|
|
Led = Module("@stdlib/generics/Led.zen")
|
|
|
|
r_value = config(str, default="330ohms", optional=True)
|
|
led_color = config(str, default="red", optional=True)
|
|
|
|
VCC = io(Power)
|
|
GND = io(Ground)
|
|
|
|
led_anode = Net("LED_ANODE")
|
|
|
|
Resistor(name="R1", value=r_value, package="0603", P1=VCC, P2=led_anode)
|
|
Led(name="D1", color=led_color, package="0603", A=led_anode, K=GND)
|