Jun-12-2021, 07:41 PM
Hi,
I've an analog sensor which generates a voltage from 0 to 3.3. It's connected to a digital converter (ADC) which outputs a range from 0 to 4095 (bits).
In C+ I use
which returns values from 0 to 100.
How is it done with Python? I tried with statements like if x >= n < xx but it's too cumbersome.
I appreciate some help.
TIA
I've an analog sensor which generates a voltage from 0 to 3.3. It's connected to a digital converter (ADC) which outputs a range from 0 to 4095 (bits).
In C+ I use
1 |
output_value = map (pin_value, 4095 , 0 , 0 , 100 ); |
How is it done with Python? I tried with statements like if x >= n < xx but it's too cumbersome.
I appreciate some help.
TIA