accept kilo and mega ohms

This commit is contained in:
2025-12-13 16:21:36 +01:00
parent ef8b6c104e
commit 6709df960d
2 changed files with 27 additions and 12 deletions

View File

@@ -7,11 +7,11 @@ This repository aim to be a collection of useful scripts when working on small e
## voltage\_divider.py
#### input:
(will ask the input through CLI if ran directly)
+ a list of resistors values (floats) separated by commas or spaces.
*example: 10 50 47 100*
+ a list of resistors values (floats) separated by commas or spaces, accept K and M suffixes for kilo and mega ohms values.
*example: 10 50 47 100 5K 1M*
+ a desired ratio \(0 ≤ ratio ≤ 1\) for the voltage divider
*example: 0.4096*
#### output:
The 5 best resistor pairs (closest to the desired ratio).
---
---