Forum: µC & Digital Electronics Motor with non-directional encoder arduino library

von Fasaso H. (fasaso)

Rate this post
not useful
Hello all,

I bought the following actuator on the internet:


There are the following pins: M+, M-, GND, C and A. By changing the 
polarity of M+ and M- I can control the direction of the motor.
At C I give 5V, GND is clear and at A I simply measure 0V or 5V 
depending on the position of the motor. I would like to drive the motor 
with a L298n module. Most PID libraries I have seen use an encoder with 
2 pulses to determine the direction. But since I define the direction of 
the motor with the H-bridge circuit of the L298n I only need 1 pulse for 
the speed (I don't have any more anyways). Now my question: is there a 
library which makes it easy to control a motor with a non-directional 

Thanks for your answers


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.