Negative Values
Moderator: RevPiModIO
I'm using an encoder with a RevPiCore, a RevPiDIO, and RevPiModIO. It appears that ct.io.MyEncoder.value returns an unsigned 32 bit, such that when I turn the encoder past zero, instead of getting -1, I get 4294967295. Is there a signed version of .value, or do I need to do my own conversion?
- RevPiModIO
- KUNBUS
- Posts: 325
- Joined: 20 Jan 2017, 08:44
- Contact:
Hi!
You can configure the IO in your Python program. Just set the signed value of your input to True.
Sven
You can configure the IO in your Python program. Just set the signed value of your input to True.
Code: Select all
your_revpi_mod_io.io.your_input.signed = True
# Now the value will show negative values
print(your_revpi_mod_io.io.your_input.value)
python3-RevPiModIO - https://revpimodio.org/ || Der RevPi ist das Beste, was passieren konnte!