Python: Nächsthöheren Normwiderstand finden mit UliEngineering
Du kannst leicht den nächsthöheren Normwiderstandswert mit der UliEngineering-Python-Bibliothek finden:
next_higher_resistor.py
from UliEngineering.Electronics.Resistors import *
from UliEngineering.EngineerIO import *
# Nächsthöheren E96-Widerstandswert für 1,5k finden
resistor = next_higher_resistor("1.5k")
print(f"Nächsthöher als 1,5k: {format_value(resistor, 'Ω')}")
# Nächsthöheren E24-Widerstandswert für 100Ω finden
resistor = next_higher_resistor("100Ω", sequence=e24)
print(f"Nächsthöher als 100Ω (E24): {format_value(resistor, 'Ω')}")Beispielausgabe
next_higher_resistor_output.txt
Nächsthöher als 1,5k: 1.58 kΩ
Nächsthöher als 100Ω (E24): 110 ΩDie Funktion next_higher_resistor() findet den nächsthöheren Normwiderstandswert aus der angegebenen E-Reihe (Standard ist 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