如何使用 UliEngineering 在 Python 中查找下一个更小的标准电阻值
你可以使用 UliEngineering Python 库轻松查找下一个更小的标准电阻值:
next_lower_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# 查找 1.5k 的下一个更小的 E96 电阻值
resistor = next_lower_resistor("1.5k")
print(f"Next lower than 1.5k: {format_value(resistor, 'Ω')}")
# 查找 120Ω 的下一个更小的 E24 电阻值
resistor = next_lower_resistor("120Ω", sequence=e24)
print(f"Next lower than 120Ω (E24): {format_value(resistor, 'Ω')}")示例输出
next_lower_resistor_output.txt
Next lower than 1.5k: 1.47 kΩ
Next lower than 120Ω (E24): 100 Ωnext_lower_resistor() 函数从指定的 E 系列中查找下一个更小的标准电阻值(默认为 E96)。
Check out similar posts by category:
Electronics, Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow