i recently purchased a Grove slide potentiometer, ran the example code to see what the min/max values are, used some code i cobbled together, and it doesn't work. Based off this code:
#include <Servo.h>
int throttle = A0; //throttle input pin
int adcIn = 0;
Servo JagTalon; //PWM line feeding Jag and Talon
Servo Talon; // Talon's PWM
void setup() {
JagTalon.attach(9);
Talon.attach(10);
}
void loop() {
adcIn = analogRead(throttle);
JagTalon.writeMicroseconds(adcIn+1000-40);
Talon.writeMicroseconds(adcIn+1000-40);
}
and that the min/max are 0/1023, can someone help me figure out why it wont work?? The speed controllers both use 1500 microseconds = neutral, 2000 microseconds = full forward
If your "motors" are continuous rotation servos, you may need to "calibrate" them. Assuming you want forward and reverse motion, put the slide to mid position, then adjust the servo pot until the servo stops rotating.
No continuous rotation servos here. Using 2 Cross the Road Electronics Talons and one TI Jaguar speed controller. The signal these get from the slide needs some adjustment suggestions??
Both Talons and Jaguars operate on a PWM signal and are driven just like servos. For both controllers its the following
1000 microseconds = full reverse
1500 = neutral
2000 = full forward
I need my throttle to be sending 1500 when the value is 0 and be writing 2000 when the value is 1023