I’m attempting to get my T200 thrusters working, I have two of them and two basic ESC. Each ESC is getting power from a seperate 14.8V battery, the thrusters work so Im not exactly sure what the issue is. When I run the example code Control the Basic ESC with Potentiometer and Arduino, my ESC makes the correct beeps notifying me that its on, and the it is delayed for 7000 microseconds, but when I turn the potentiometer nothing happens. When I turn the knob all the way left or right, the thruster turns on full power and doesn’t turn off unless I unplug the arduino. I tried 4 potentiometers and 3 different arduinos. The thrusters and ESC work fine, I think its either my code or the potentiometer but wanted to see if anyone had a fix or has seen this issue before. Below is my code for two thrusters controlled by the same potentiometer. I would like to eventually replace the potentiometer with a joystick at some point. Thanks!
#include <Servo.h>
byte servoPin1 = 9;
byte servoPin2 = 10;
byte poteniometerPin = A0;
Servo servo1;
Servo servo2;
void setup() {
servo1.attach(servoPin1);
servo2.attach(servoPin2);
servo1.writeMicroseconds(1500);
servo2.writeMicroseconds(1500);
delay(7000);
}
void loop() {
int potVal = analogRead(poteniometerPin);
int pwmVal = map(potVal, 0, 1023, 1100, 1900);
servo1.writeMicroseconds(pwmVal);
servo2.writeMicroseconds(pwmVal);
}