Thank you all, hopefully this is better for the guidelines (again, just got my noob badge!). If I am posting on an incorrect forum, please provide guidance.
What I am attempting to do (and have done somewhat successfully so far) is upload the code (acquired from "3dfuns" (credit where it's due yet cannot get in touch with them) and posted in it's entirety below) to an ESP8266 D1 Mini, connect an LED (to be used as on/off light) and two servos (SG90 for the 180 and FS90R for the 360) which are to be used for steering left/right (180) and to go forward/reverse with increasing/decreasing speed (360) and are set to be controlled by an app (RoboRemo). I am believing the coding is correct for my intentions and the 3V battery that's in use powers everything (as I can get both servos working simultaneously). My concern is that somewhere in the coding the ability to accelerate/decelerate on the 360 servo is incorrect and I am still kinda green to programming to locate it, if that is the case. The app or power supply may be where the disconnect is. In the app, I have set the min/max to 1000/2000, but the servo just goes counterclockwise only for both the 4 and 15 pin (D2/D8 respectively on the ESP). hopefully this answers all questions and adheres to community guidelines. Thank you.
// Pin number --> neopixel led 13/ servo 5/ motor 4,15
// Range --> motor 1000~2000 / Servo 60~120 degree
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <Servo.h>
#include "Adafruit_NeoPixel.h"
#define motor_d1 4
#define motor_d2 15
#define led_lighting 13
#define led_num 1
#define servo_streeing 5
Adafruit_NeoPixel lighting = Adafruit_NeoPixel(led_num, led_lighting, NEO_GRB + NEO_KHZ800);
const char *ssid = "CMs_autobike";
const char *pw = "";
IPAddress ip(192, 168, 0, 1);
IPAddress netmask(255, 255, 255, 0);
const int port = 9876;
int led_state;
int motor_speed = 0;
int servo_angle = 0;
int val_motor;
char cmd[100];
int cmdIndex = 0;
WiFiServer server(port);
WiFiClient client;
Servo handle;
void setup() {
pinMode(motor_d1, OUTPUT);
pinMode(motor_d2, OUTPUT);
pinMode(led_lighting, OUTPUT);
analogWrite(motor_d1, 0);
analogWrite(motor_d2, 0);
handle.attach(servo_streeing);
// handle.write(50);
lighting.begin();
lighting.setBrightness(100);
lighting.setPixelColor(0, 0, 0, 0);
lighting.show();
WiFi.softAPConfig(ip, ip, netmask);
WiFi.softAP(ssid, pw);
server.begin();
Serial.begin(115200);
}
boolean cmdStartsWith(const char *st) {
for (int i = 0;; i++) {
if (st[i] == 0) return true;
if (cmd[i] == 0) return false;
if (cmd[i] != st[i]) return false;
}
return false;
}
void exeCmd() {
if (cmdStartsWith("th") ) {
motor_speed = atoi(cmd + 3);
}
if (motor_speed > 1000) {
val_motor = map(motor_speed, 1000, 2000, 0, 1023);
analogWrite(motor_d2, val_motor);
// Serial.print("th 1500 > ");
// Serial.println(val_motor);
}
if (motor_speed < 1000) {
val_motor = map(motor_speed, 1000, 0, 0, 1023);
analogWrite(motor_d1, val_motor);
// Serial.print("th 1500 < ");
// Serial.println(val_motor);
}
if (motor_speed == 1000 ) {
analogWrite(motor_d1, 0);
analogWrite(motor_d2, 0);
}
if (cmdStartsWith("st") ) {
servo_angle = atoi(cmd + 3);
handle.write(servo_angle);
// Serial.println(servo_angle);
}
if (cmdStartsWith("w")) {
led_state = (led_state == LOW) ? HIGH : LOW;
if (led_state == HIGH) {
lighting.setPixelColor(0, 255, 255, 255);
lighting.show();
} else {
lighting.setPixelColor(0, 0, 0, 0);
lighting.show();
}
}
}
void loop() {
if (!client.connected()) {
client = server.available();
return;
}
if (client.available()) {
char c = (char)client.read();
if (c == '\n') {
cmd[cmdIndex] = 0;
exeCmd();
cmdIndex = 0;
} else {
cmd[cmdIndex] = c;
if (cmdIndex < 99) cmdIndex++;
}
}
}