07-11-2026, 02:18 AM
Code:
/*
* Language: English | Русский: ../RU/DIR_DIR_PWM/ | Қазақ: ../KZ/DIR_DIR_PWM/
*
* This code demonstrates motor control using the AlashMotorControlLite library.
* It sets different rotation speeds for the motor with delays between them.
* Code written for Alash engineering.
*/
#include "AlashMotorControlLite.h"
// Create motor object with DIR_DIR_PWM mode and pins inA = 4, inB = 5, PWM = 6
AlashMotorControlLite motor(DIR_DIR_PWM, 39, 46, 9);
void setup() {
}
void loop() {
motor.setSpeed(100); // Set forward rotation speed
delay(3000); // Delay 3 seconds
motor.setSpeed(0); // Stop motor
delay(3000); // Delay 3 seconds
motor.setSpeed(-100); // Set reverse rotation speed
delay(3000); // Delay 3 seconds
motor.setSpeed(0); // Stop motor
delay(3000); // Delay 3 seconds
}
motor.zip (Size: 560 bytes / Downloads: 18)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
motor.ino.merged.zip (Size: 184.36 KB / Downloads: 9)
YouTube: https://www.youtube.com/c/KinCony
Online Store: https://shop.kincony.com
Alibaba Store: https://kincony.en.alibaba.com/
Online Store: https://shop.kincony.com
Alibaba Store: https://kincony.en.alibaba.com/

