My team recently bought
these ultrasonic range finders. We are having a few problems wiring and programming them.
Attched is a diagram that shows how we wired them.
To program them we used:
Code:
if (run_count<2){
rc_dig_out13 = 1;
} else if(run_count >= 40){
rc_dig_out13 = 0;
run_count =0;
Get_Encoder_1_persec = Get_Encoder_1_Count() - last_count;
last_count = Get_Encoder_1_Count();
//printf("Sensor: %d \r", (int)Get_Encoder_1_persec);
}
printf("Sensor: %d \r", Get_Analog_Value(rc_ana_in01));
run_count++;
However when it outputs all we get is the number 11. Does anyone know what is wrong?