And like the unit metre, you can have km for kilo-meter, same for kHz, MHz etc. The scientists call this how many times per minute or per seconds " FREQUENCY".įrequency can be very high, eg 1,000 times (cycles) per second, which has a special name called "Hertz" or " Hz". ie, you are repeating the two second action 30 times per minute. (1.4) So in one minute, you are doing left, right, left, right. Then you will find motor turns for one second, then stops for one seconds, and so on. (1.3) Now if you repeatedly flip SW1 to right for one second, then left for one second, then right, then left. (1.2) Now if you flip SW1 to left, and keep SW2 stay in its current position, then +12V has no way (circuit) to pass current, and no current in coil, so the motor stops. The electric current will flow from +12V, following the little pink arrows, passing through the coil, I mean the motor coil, and the motor will turn happily non stop. (1.1) Suppose the switches SW1 and Sw2 are in their positions as shown. Now let us first look at the picture below. Part 1 - Over simplified explanation of the L298N Dual Bridge Motor Driver What is the meaning of status, direction, speed in the function declaration?Īlso pwm.changeDut圜ycle(speed), What is the speed? Pwm_B = GPIO.PWM(Motor_B_EN, 1000) def motor_left(status, direction, speed):#Motor 1 positive and negative rotation Here is the link to the entire project, please check this: # motor_A: Pin8,Pin10 | motor_B: Pin13,Pin12ĭef motor_right(status, direction, speed):#Motor 2 positive and negative rotationĭef motor_left(status, direction, speed):#Motor 1 positive and negative rotation
I am unable to understand parts of the code #!/usr/bin/python3