I would like to control my dc motor using the Arduino Uno WiFi Rev2 using an html range slider. Now I can control the motors speed and direction using push buttons just fine. My code is posted below of what I've done so far.
client.println("<style>");
client.println(".class-name{writing-mode: bt-lr; webkit-appearance: slider-vertical;width: 8px;height: 175px;padding: 0 5px;}</style>");
client.println("<center><input type=\"range\" class=\"class-name\" orient=\"vertical\" id=\"range\" min=\"0\" max=\"255\" step=\"0\" onchange=\"motor1(this.value)\" value=\"0\"></center>");
This code below is the current button code. I need the below code to be used by the slider code above:
if (currentLine.endsWith("GET /MONFWD")) {
digitalWrite(MOTOR_A_ONE, HIGH); // Establishes forward direction of Channel A
digitalWrite(MOTOR_A_TWO, HIGH); // ENGAGE BRAKE
delay(1000); // DELAY BEFORE RELEASING BRAKE
digitalWrite(MOTOR_A_TWO, LOW); // Disengage the Brake for Channel A
analogWrite(MOTOR_A_ENGAGE, 255); // Spins the motor forward on Channel A at full speed