Week 6 L293D Motor Driver IC
How the motor driver Works
#This is the pin out starting from the top left (Notch is the top)
#Pin 1 enable = GPIO pin 1 (PWM pin)
#Pin 2 = GPIO pin 2
#Pin 3 OUT 1 = motor lead 1
#Pin 4 GND = GND Pi
#Pin 5 If using an external power source connect to the ground of that.
#Pin 12, 13 are also GND that can be used to ground the external power supply or Pico
#Pin 4,5,12 and 13 are internally connected so can be used for any ground.
#Pin 6 = motor lead 2
#Pin 7 = = GPIO 3
#Pin 8 (Vs) = 3.3V on Pico (Supplies power to the motor) Can use external power.
#Pin 16 (Vss) = 3.3 V Powers the board logic
#IC pins are numbered 1 and up anticlockwise.
# pin 16 is top right.
Python Coding
- Using Inputs
- Casting stings to numbers from input
- String functions (To split an input)
- Homework Turn the hbridge.py code into requestHBridge.py from the user to go forward or back and at what speed. Make sure you set the enable pin to off for a second before you change the speed/direction of the motor. Don't hook up any electronics just print out what is happening.


Comments
Post a Comment