Code: Select all
#!/usr/bin/env python2.7 import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setup(25, GPIO.OUT) fan = GPIO.PWM(25, 100) print "start" fan.start(0) sleep (5) print "Run 100%" fan.ChangeDutyCycle(100) sleep (5) print "Run 50%" fan.ChangeDutyCycle(50) sleep (5) print "Run 25%" fan.ChangeDutyCycle(25) sleep(5) print "Stop" fan.stop() GPIO.cleanup()
It might help if you show us your code and tell us how you tried to enable speed control , on most L298N motor controllers you only have to apply a PWM signal to the ENA & ENB pins on the motor control board to get speed control.arindamsingha wrote: ↑Thu Jan 03, 2019 2:40 pmDear Chetuk sir, could you please send me your demo code, I have tried all the processes available on the internet for using PWM signal to control the speed of the motor, but none of this is worked. I will be really grateful if you kindly give me your demo code, just to control the speed through PWM using a raspberry pi. Just give me a reply, I'll give you my email id.
Thanx in advance.