Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuxuanlin committed Jun 23, 2024
1 parent 36eaa52 commit 436d43b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
3 changes: 3 additions & 0 deletions draft/preview/Winget.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,6 @@ winget install KiCad.KiCad # 开源的电路原理图、
- Pylogmon.pot

- Python: Python.Python.3.xx


C:\Users\power\AppData\Local\Programs\KiCad\8.0\share\kicad\symbols
54 changes: 54 additions & 0 deletions draft/preview/使用SKiDL画PCB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 使用 SKiDL 画 PCB

## 环境配置

```sh
winget install KiCad.KiCad # 目前使用8.0.3版本
pip install git+https://github.com/devbisme/skidl@development # 要使用新版,并在程序头加入 set_default_tool(KICAD8)
```

环境变量:

```
set KICAD8_SYMBOL_DIR=C:\Users\power\AppData\Local\Programs\KiCad\8.0\share\kicad\symbols
```

发现上面的代码没效果,要手动配置用户变量

## 参考代码

```py
from skidl import *

#print(lib_search_paths)
set_default_tool(KICAD8)


# 创建网络
vcc = Net('VCC') # 电源
gnd = Net('GND') #
btn = Net('BTN') # 按键信号
led = Net('LED') # LED 控制信号

# 按键电路
button = Part('Switch.kicad_sym', 'SW_Push', footprint='Button_Switch_SMD:Nidec_Copal_SH-7040B')
pullup_resistor = Part('Device.kicad_sym', 'R', value='10k', footprint='Resistor_THT:R_Array_SIP4') #R_0_1
button[1] += gnd
button[2] += btn
pullup_resistor[1] += vcc
pullup_resistor[2] += btn

# LED 电路
#led_resistor = Part('Device.kicad_sym', 'R', value='330', footprint='Resistor_SMD:R_0603')
#led_diode = Part('Device.kicad_sym', 'LED', footprint='LED_SMD:LED_0805')
#led_resistor[1] += vcc
#led_resistor[2] += led
#led_diode[1] += led
#led_diode[2] += gnd

# 生成网表
generate_netlist()
print("Netlist generated successfully.")
```

然后在 PCB 页面导入网表

0 comments on commit 436d43b

Please sign in to comment.