I would like to drive TWO DC motors of the car. Front have gear to turn the car to LEFT or RIGHT depending on the HIGH/LOW signals to L298N pins. Back motor can take car to FORWARD or REVERSE depending on the rotation.
There are 5 digital Pins and One Analog. Is it possible to drive two motors through Bolt directly using L298N? Giving required signals from digital pins for clockwise and anticlockwise rotation of motors and supplying PWM signals from A0?
Will following code will drive the motor?
It is definitely possible. (Except for the part of supplying PWM signal using A0, which is not possible).
You will have to setup the L298N motor driver to use 3.3v as control voltage. Next have the enable pins of the driver connected to 3.3v.
Connect each control pin of the motor driver to 1 digital pin of the Bolt WiFi module.
Use appropriate diodes and connect the motors to the outputs of the L298N. You will then be able to use the remote API such as digitalWrite and digitalMultiWrite to control the 4 digital pins.
You can also use analogWrite on these digital pins to set the PWM value on the pin.
Yes possible. To run DC motor with L298N there requres three connections. In L298N you will see two jumpers one at left and other at right of the four Pins used to drive two motors (positive-negative-positive-negative). You need to remove these jumpers and give HIGH from one of the bolt pin. These pins are used to enable L298N to run motors in PWM mode. Now from program increase the speed in steps. Hope you understand.