Measure voltage polarity with io pin?
Botdocter
Posts: 271
I have been searching through the prop manual, but wasn't able to find anything.
I need to measure the polarity of 5v. So one moment it will be +5V an then the next -5V. nothing in between just like a switch on and of.
i use the robot control board.
any help is welcome!
I need to measure the polarity of 5v. So one moment it will be +5V an then the next -5V. nothing in between just like a switch on and of.
i use the robot control board.
any help is welcome!
Comments
It is a weird decoder from a rc car that is used for sensing wheel direction.
Disconnected is in the straight forward, -5v is left and +5v is right.
I was asking myself "did botdocter code only a few codelines by himself?"
My answer ist YES! for sure! But why is he asking then? I think it is quite simple
pseudo-code
if (ina[pin1] == 1) and (ina[pin2] == 0)
open - no voltage
if (ina[pin1] == 1) and (ina[pin2] == 1)
+5V
if (ina[pin1] == 0) and (ina[pin2] == 0)
-5V
best regards
Stefan
I don't know exactly what you mean with this though: