mjs513
Senior Member+
I'm slightly retarded when it comes to anything programming related sooo...
Not sure what to do to setup for the index pin
Code:The full constructor allows for the INDEX, HOME and TRIGGER pins if available: QuadEncoder(uint8_t encoder_ch = 255, uint8_t PhaseA_pin = 255, uint8_t PhaseB_pin = 255, uint8_t pin_pus = 0, uint8_t index_pin = 255, uint8_t home_pin = 255, uint8_t trigger_pin = 255);
I'm using encoder channel "1" with A-B-Z on pins 0-1-2, the unsigned integer thing is throwing me off, I only need the phase AB and index
If you look at some of the examples and check the readme you will find what you are looking for. But simple answer to get you started is that you put the pin numbers in the order indicated, and unused pins you either leave blank or put in 255. In your case the format would be
Code:
QuadEncoder myEnc1(1, 0, 1, 0, 2)
Which means use encoder channel1 , phaseA pin = 0, phaseB pin =1, use pullups = 0, index pin = 2.