Hi everyone,
I have a N20 Gearbox DC Motor with Encoder,
While running the motor I know the direction with output values of pins. Than I decied to use One Signal pin of rotary encoder to count ++ or --
But I realized that one direction counts more than the other side.
I cannot understand how it is generating signals.
Should I use 2 pins of Encoder?
I suggest that you start with a program that only controls the motor (no EEPROM and no IR) to keep things as simple as possible until you figure out how to control the motor.
I don't understand why you would have a function called setEncoderDirection(). In my mind you GET data from an encoder.
Robin2:
I suggest that you start with a program that only controls the motor (no EEPROM and no IR) to keep things as simple as possible until you figure out how to control the motor.
I don't understand why you would have a function called setEncoderDirection(). In my mind you GET data from an encoder.
...R
beacuse Although I stopped the motor, the rotary encoder generates signal for a second after set pinout values LOW. The recieved signals must be processed.
So I have to remember the last command before STOP
You presumably know the motor direction so you just need to count pulses on one encoder pin and add/subtract to/from the count according to the motor direction.
If you use both encoder pins you can determine the direction, but if you are controlling the motor this should not be necessary and is only usually used to read an externally driven encoder.
I don't understand why you would have a function called setEncoderDirection(). In my mind you GET data from an encoder.
beacuse Although I stopped the motor, the rotary encoder generates signal for a second after set pinout values LOW. The recieved signals must be processed.
So I have to remember the last command before STOP
I'm not convinced.
I could understand saveEncoderDirection(), but not setEncoderDirection()