(to OP) Yes, reading the reference resistor is a suspicious bit of code. It suggests that your circuit is not designed properly.
(to OP) Yes, reading the reference resistor is a suspicious bit of code. It suggests that your circuit is not designed properly.