![how to connect power to osepp l298n motor driver how to connect power to osepp l298n motor driver](https://electronicsmith.com/wp-content/uploads/2020/03/L298N-Motor-Driver-Module-Pinout.png)
If the D7 Pin goes HIGH, or blinks in other words, the event called "TEST" gets published to the Particle Cloud. Note that this is setup for the Blynk App to be able to make the D7 Pin blink and have the Second Photon react to this.
How to connect power to osepp l298n motor driver code#
With this code the Second Photon will blink its onboard D7 LED when the First Photon blinks it's D7 LED. This means you can force the car to drive around slowly in tight spaces to avoid hitting obstacles.
![how to connect power to osepp l298n motor driver how to connect power to osepp l298n motor driver](https://cdn.shopify.com/s/files/1/0069/6513/3376/products/AA034_3.jpg)
The enable pins can also be Pulse Width Modulated (PWM) via a digital output on the Photon to control motor speed. This is the same for the ENB Pin and IN3/IN4 Pins. The IN1 Pin and IN2 Pin, in different combinations, power the Drive motor to turn in different directions. The ENA (Enable A ) pin is a kill switch for the first motor, it must be set to high to drive a motor in either direction. See the video and schematic for a better explanation. The tricky part was the 6 "Control Pins", they took some time to figure out. Also the switched power was run to the 12V input. So at this point, the obvious connections were made, output 1 of the motor controller went to the drive motor, and output 2 of the motor controller went to the steering motor. It has a 12V input, (well, a max of 12V) we have a 9.6V battery so we are under that threshold, 2 outputs for the motors it can drive, and a 5V output( this will be perfect for powering both Photons). Basically this unit can turn 2 separate DC motors in different directions, at different speeds, independently of each other. There are other motor controllers out there, but this what I found at the Hobby Shop, and We knew it could get the job done.
![how to connect power to osepp l298n motor driver how to connect power to osepp l298n motor driver](https://i.stack.imgur.com/n7C3i.png)
A little bit about the motor controller we used.