View Single Post
  #15   Spotlight this post!  
Unread 13-07-2005, 00:07
Gdeaver Gdeaver is offline
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,358
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: Measuring a Pulse Width

Function generators? Scopes? All that to try and get a FRC to use a sonar range sensor? Most pic basic interpreters and compilers have a pulse in and pulse out function in the language. The stamp sample code is very easy but, with the FRC and C this common simple device is giving people fits. I have a Daventech SRF04 which is very similar to the stamp device except it has a separate trigger and pulse pin. I soldered 4 wires to it. Plugged it into a bread board with a Pic 18F452 basic interpreter chip and wrote the following code.
func main()
dim range
loop:
sonar 0,1,range
print "Distance=",range/64,"inches"
pause 20
goto loop
endfunc

In about 1 hour I was testing it out. This post points out a major problem with the FRC as it is now. EE's love it, non professionals fight it. I don't have any answers but, to take First further with sensors and autonomous mode, something needs to change. The challenge to sensors should not be the hardware-software implementation but, the application of the info they give us to come up with strategies for the game. Too many teams this year chose an autonomous mode strategy of doing nothing.