View Single Post
  #1   Spotlight this post!  
Unread 28-01-2008, 22:43
nekng's Avatar
nekng nekng is offline
Former 1836 Captain
AKA: Nate
FRC #1836 (MilkenKnights)
Team Role: Alumni
 
Join Date: Aug 2006
Rookie Year: 2007
Location: Los Angeles
Posts: 43
nekng is on a distinguished road
Ultrasonic Range Finder

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?
Attached Thumbnails
Click image for larger version

Name:	Sensor.jpg
Views:	108
Size:	60.8 KB
ID:	6166