-->
Page 1 of 1

Newb in over his head w/ esp8266, basic and L298N / DC Motor

PostPosted: Mon Apr 16, 2018 2:05 pm
by asn
I've been trying to automate my blinds, and found some code that I was able to tweek and make it work with servo's, a ESP8266 board, and a default.bas program. The problem is, the servo didn't have enough torque, so I bought some DC motors, and some L298N boards.

It appears as if I can't use the PWM wire on the DC motors via the L298N board, and I need 2 more connections that both say "enable motor A".

The L298N board I am using is this one: https://www.amazon.com/DAOKI-Controller ... ords=l298n

What I am trying to figure out, is how to wire it to the ESP8266 board, and how to convert the following code to tell it to run 5 seconds in one direction for close, and one that does 5 seconds in the other direction for open.

Can anyone help?

Thanks!!

if servoVar = close then
print "its close"
io(servo,4,10)
else
if servoVar = open then
print "its open"
io(servo,4,160)
else
if servoVar = shade then
print "its shade"
io(servo,4,170)
else
print "wrong"
endif
endif
endif

Re: Newb in over his head w/ esp8266, basic and L298N / DC M

PostPosted: Tue Apr 17, 2018 1:57 pm
by kaxx1975
Have you tried a delay(5000), then a stop function after each rotation function? I'm also wondering if a stepper motor would be more beneficial?

Re: Newb in over his head w/ esp8266, basic and L298N / DC M

PostPosted: Tue Apr 17, 2018 3:51 pm
by asn
I haven't tried anything like that yet, but am pretty sure the code will work, because it worked with a Servo.

I am I'm still trying to figure out how to wire the L298N to the esp8266 board, then need to know how to use "mmiscool basic" to access the L298N.