View Single Post
  #7   Spotlight this post!  
Unread 16-01-2008, 14:32
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: SONAR Sensor Software Driver

We got the Vex sonar working last night using Mike's driver. I'm really impressed by the whole thing -- it can see a 3' x 4' board at about 15 feet!

Note: the documentation that came with the Sonar sensor I got (from Radio Shack, back when they sold Vex stuff) had the "input" and "output" functions backwards. See my earlier post in this thread.

The wire marked "input" is an input to the sonar, and it needs to come from a rc_digital_io_NN pin configured as an output. You need to set a couple of macros in sonar.h to tell it which pin you are using for the sonar input.

The output needs to go to a digital_io pin that acts as an interrupt. We used rc_digital_io_01. I think that is the default in Mike's code.
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.