Shop OBEX P1 Docs P2 Docs Learn Events
Motor Speed Control — Parallax Forums

Motor Speed Control

Does anyone has a program for controlling speed on a dc motor?
I am using pwm with a L298N Dual H-Bridge Motor Driver Module. Thanks in advance.


  • The tricky thing about the BASIC Stamp is that it doesn't have set-and-forget PWM capability, so motor control without external help is quite difficult -- unless you only need to coast, stop, run full-speed forward, or run full-speed reverse.

  • I have some control using the following command :
    PWM 1, 80, 1000

    80 signifies duty cycle. Formula for duty cycle is (duty/256) * 5 v = duty cycle.
    By increasing duty cycle greater than 80 (max is 256) voltage on dc motor increases and therefore speed increases.

Sign In or Register to comment.