Servo's and ESPs?
Posted: Tue Jul 12, 2016 2:15 am
Hello everyone!
I'm working on making an automated door closer for my dorm room. Currently, I have a NodeMCU ESP running Lua and am trying to get a servo to work on this thing.
I have an outside power source, have tested the servo multiple times to ensure that it works, and have tested just about everything else. I have narrowed it to the PWM in my Lua code, but can't seem to figure out what the problem is. Here is my current, albeit lame, setup.
Here is the code I am executing through Lua Uploader:
Obviously the LED is in the place of the signal input of the servo motor. I've looked at the servo library of the Arduino and ESP and both have the following constants defined.
I've been trying to figure this out for months now, and I've finally decided to post on this forum. Please help!
I'm working on making an automated door closer for my dorm room. Currently, I have a NodeMCU ESP running Lua and am trying to get a servo to work on this thing.
I have an outside power source, have tested the servo multiple times to ensure that it works, and have tested just about everything else. I have narrowed it to the PWM in my Lua code, but can't seem to figure out what the problem is. Here is my current, albeit lame, setup.
Here is the code I am executing through Lua Uploader:
Code: Select all
pwm.setup(1, 544, 512)
pwm.start(1)
print("sup")
tmr.delay(5000000)
gpio.write(1, 1)
Obviously the LED is in the place of the signal input of the servo motor. I've looked at the servo library of the Arduino and ESP and both have the following constants defined.
Code: Select all
#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo
#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo
#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached
I've been trying to figure this out for months now, and I've finally decided to post on this forum. Please help!