Paul_KD7HB:
That can't possibly be the code you are using. Please show the actual program with the proper unsigned long pulse lengths properly defined.
Paul
Hey Paul! I was more just fiddling around to see how much having all those rc signals inputting into the board would lag everything. But, in the past few hours I've gotten the code to this point and it seems to be interpreting everything alright (and mapping all values to servo friendly ones between 0-180), albeit very slowly.
If you see something that could be improved I'd love to give it a shot. I'm sure any little improvements would help alot. I'm pretty new to things so there might be some pretty basic things going right over my head.
#define rcPin0 3
#define rcPin1 4
#define rcPin2 5
#define rcPin3 6
#define rcPin4 7
#define rcPin5 8
int left_y_in = 0;
int right_x_in = 0;
int right_y_in = 0;
int left_x_in = 0;
int gear_in = 0;
int aux1_in = 0;
int lefty;
int rightx;
int righty;
int leftx;
int gear;
int aux1;
void setup() {
pinMode(rcPin0, INPUT);
pinMode(rcPin1, INPUT);
pinMode(rcPin2, INPUT);
pinMode(rcPin3, INPUT);
pinMode(rcPin4, INPUT);
pinMode(rcPin5, INPUT);
}
void loop() {
left_y_in = pulseIn(rcPin0, HIGH, 29000);
right_x_in = pulseIn(rcPin1, HIGH, 23000);
right_y_in = pulseIn(rcPin2, HIGH, 20000);
left_x_in = pulseIn(rcPin3, HIGH, 20000);
gear_in = pulseIn(rcPin4, HIGH, 29000);
aux1_in = pulseIn(rcPin5, HIGH, 28000);
lefty = map(left_y_in, 881, 2069, 180, 0);
rightx = map(right_x_in, 2069, 882, 0, 180);
righty = map(right_y_in, 882, 2068, 0, 180);
leftx = map(left_x_in, 2066, 884, 0, 180);
if(gear_in < 1000){gear = 0;}
if((gear_in > 1200) && (gear_in < 1800)){gear = 90;}
if(gear_in >1800){gear_ = 180;}
if(aux1_in < 1000){aux1 = 0;}
if((aux1_in > 1200) && (aux1_in < 1800)){aux1 = 90;}
if(aux1_in >1800){aux1 = 180;}
}