I am trying to control two motors using bolt. In that case, I am using L298N motor driver, Bolt IoT module mainly. My code is in Python.
My question is-
How to connect three motor driver with to Bolt IoT board with 9v battery?
I connected as-
Driver
Positive(1)----->5V
GND------------->5V(GND) & Bolt board GND
Positive(2)------>Bolt board 5V
But still the motor is not rotating.
My code -
from boltiot import Bolt
api_key = "(not shown here)"
device_id = "(not shown here)"
mybolt = Bolt(api_key, device_id)
while True:
print("Write On or Off")
i = int(input("Type 1 = MOVE FORWARD\n2 = MOVE BACKWARD\n3 = MOVE LEFT\n4 MOVE RIGHT"))
if i==1: #forward
response = mybolt.analogWrite('A0', '255')
response = mybolt.digitalWrite('1', "LOW")
response = mybolt.digitalWrite('2', "HIGH")
response = mybolt.digitalWrite('3', "LOW")
response = mybolt.digitalWrite('4', "HIGH")
print(response)
elif i==2: #backward
response = mybolt.analogWrite('A0', '255')
response = mybolt.digitalWrite('1', "HIGH")
response = mybolt.digitalWrite('2', "LOW")
response = mybolt.digitalWrite('3', "HIGH")
response = mybolt.digitalWrite('4', "LOW")
elif i==3: #left
response = mybolt.analogWrite('A0', '255')
response = mybolt.digitalWrite('1', "HIGH")
response = mybolt.digitalWrite('2', "LOW")
response = mybolt.digitalWrite('3', "LOW")
response = mybolt.digitalWrite('4', "HIGH")
elif i==4: #right
response = mybolt.analogWrite('A0', '255')
response = mybolt.digitalWrite('1', "LOW")
response = mybolt.digitalWrite('2', "HIGH")
response = mybolt.digitalWrite('3', "HIGH")
response = mybolt.digitalWrite('4', "LOW")
How to connect PWM pin with Bolt board with digitalMultiWrite?
Provide the code please.
Please help me.