Hello,
I have a Portenta_MachineControl, and I have an encoder connected,
using the example library, I am able to see the encoder pulses, however the encoder revolutions remain at 0, its as simple as a division, but the current method does not seem to address it on a high level.
Encoder 0 State: 11
Encoder 0 Pulses: 17270
Encoder 0 Revolutions: 0
What is the correct way to change the pulsesPerRev parameter?
Looking at the QEI function:
/**
* Constructor.
*
* Reads the current values on channel A and channel B to determine the
* initial state.
*
* Attaches the encode function to the rise/fall interrupt edges of
* channels A and B to perform X4 encoding.
*
* Attaches the index function to the rise interrupt edge of channel index
* (if it is used) to count revolutions.
*
* @param channelA mbed pin for channel A input.
* @param channelB mbed pin for channel B input.
* @param index mbed pin for optional index channel input,
* (pass NC if not needed).
* @param pulsesPerRev Number of pulses in one revolution.
* @param encoding The encoding to use. Uses X2 encoding by default. X2
* encoding uses interrupts on the rising and falling edges
* of only channel A where as X4 uses them on both
* channels.
*/
QEI(PinName channelA, PinName channelB, PinName index, int pulsesPerRev, Encoding encoding = X2_ENCODING);