Hi, now I’m trying to use servo motor with ESP32 and mongoose os.
My goal is when I put a button that is connected to PIN No.13, servo motor rotating CW or CCW.(servo motor’s signal cable is connected to PIN No.14)
The following is my javascript code.
load(‘api_gpio.js’);
load(‘api_pwm.js’);
GPIO.set_mode(13, GPIO.MODE_INPUT);
GPIO.set_button_handler(13, GPIO.PULL_UP, GPIO.INT_EDGE_NEG, 20, function(x) {
PWM.set(14, 500, 50)
}, true);
Is my understanding correct?
This is my first time to make IoT device and use javascript.
Please help.