Files
Akhil Velagapudi 8e9c355a3f Disallow dots in names (#150)
* Disallow dots in names

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Bump stdlib

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Simplify is_instance_position

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update snapshot

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-15 18:06:28 -04:00

23 lines
741 B
Python

"""
A simple LED circuit with current limiting resistor.
This demonstrates using standard components to create a basic LED driver.
"""
load("@stdlib/interfaces.zen", "Power", "Ground")
Resistor = Module("@stdlib/generics/Resistor.zen")
Led = Module("@stdlib:v0.2.10/generics/Led.zen")
# Configuration parameters
r_value = config("r_value", str, default="330ohms", optional=True)
led_color = config("led_color", str, default="red", optional=True)
# IO ports
vcc = io("vcc", Power)
gnd = io("gnd", Ground)
# Internal net for LED anode
led_anode = Net("LED_ANODE")
# Create the LED circuit
Resistor(name="R1", value=r_value, package="0603", P1=vcc.NET, P2=led_anode)
Led(name="D1", color=led_color, package="0603", A=led_anode, K=gnd.NET)