Note: These calculations neglected the effect of the pulldown resistor. Corrected results are below.
Here, all the work is done for you MrDEB. This is based on a ladder of 1k, 1% resistors as shown in the table. Build it exactly as shown (with none of your typical improvements) and this table shows the values you will get for each switch. Test* for the range of values shown and it will work every time. Remember, integer math is INTEGER values only - no decimal points.
The range of values for each switch is calculated assuming all +1% resistors on one side of the voltage divider and all -1% resistors on the other. It's extremely unlikely you would get this distribution, but the range calculated here includes all of the possibilities.
* I'm sorry, "test" is going to generate many more pages here.
Here, all the work is done for you MrDEB. This is based on a ladder of 1k, 1% resistors as shown in the table. Build it exactly as shown (with none of your typical improvements) and this table shows the values you will get for each switch. Test* for the range of values shown and it will work every time. Remember, integer math is INTEGER values only - no decimal points.
The range of values for each switch is calculated assuming all +1% resistors on one side of the voltage divider and all -1% resistors on the other. It's extremely unlikely you would get this distribution, but the range calculated here includes all of the possibilities.
* I'm sorry, "test" is going to generate many more pages here.
Last edited: