View Single Post
  #3   Spotlight this post!  
Unread 11-01-2015, 00:13
dellagd's Avatar
dellagd dellagd is offline
Look for me on the field!
AKA: Griffin D
FRC #2590 (Nemesis) #2607 (The Fighting Robovikings)
Team Role: Mentor
 
Join Date: Sep 2011
Rookie Year: 2011
Location: PA
Posts: 890
dellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond reputedellagd has a reputation beyond repute
Re: How do Ultrasonic sensors work? Java

Quote:
Originally Posted by hzheng_449 View Post
I'm assuming you're using something like the vex ultrasonic sensor (otherwise you should be able to treat an ultrasonic like any other sensor).

In this case, I believe that the pingChannel is the PWM out pin that goes into the input wire and the echoChannel is the analog channel you read the final value on.
If he is in fact referring to the vex one, or the venerable HS-SR04, then the genreal process is to sent a 10 microsecond pulse on the trigger and then get the width of the pulse sent back out on the echo pin (both digital). The width of that response pulse is proportional to the distance.
__________________
Check out some cool personal projects in computers, electronics, and RC vehicles on my blog!

2016 MAR DCMP Engineering Excellence Award
2016 MAR Westtown Innovation in Control Award
2016 MAR Hatboro-Horsham Industrial Design Award
2015 Upper Darby District Winners - Thanks 225 and 4460!
2015 Upper Darby District Industrial Design Award
2015 Hatboro-Horsham District Winners - Thanks 2590 and 5407!
2014 Virginia Regional Winners - Thanks so much 384 and 1610, I will never forget that experience!
2014 Virginia Quality Award
2014 MAR Bridgewater-Raritan Innovation in Control Award
2014 MAR Hatboro-Horsham Gracious Professionalism Award
2013 MAR Bridgewater-Raritan Innovation in Control Award
2012 MAR Lenape Quality Award