Cómo encontrar el siguiente valor de resistor estándar superior en Python usando UliEngineering
Puedes encontrar fácilmente el siguiente valor de resistor estándar superior usando la librería Python UliEngineering:
next_higher_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# Encontrar el siguiente valor E96 superior a 1.5k
resistor = next_higher_resistor("1.5k")
print(f"Sig. superior a 1.5k: {format_value(resistor, 'Ω')}")
# Encontrar el siguiente valor E24 superior a 100Ω
resistor = next_higher_resistor("100Ω", sequence=e24)
print(f"Sig. superior a 100Ω (E24): {format_value(resistor, 'Ω')}")Ejemplo de salida
next_higher_resistor_output.txt
Sig. superior a 1.5k: 1.58 kΩ
Sig. superior a 100Ω (E24): 110 ΩLa función next_higher_resistor() encuentra el siguiente valor de resistor estándar superior de la serie E especificada (por defecto es E96).
Echa un vistazo a artículos similares por categoría:
Electronics, Python
Si este artículo te ha ayudado, considera invitarme a un café o hacer una donación vía PayPal para apoyar la investigación y publicación de nuevos artículos en TechOverflow