ROBOTC.net forums
http://www.robotc.net/forums/

ultrasonic sensor
http://www.robotc.net/forums/viewtopic.php?f=11&t=171
Page 1 of 1

Author:  Solen [ Tue May 15, 2007 1:05 pm ]
Post subject:  ultrasonic sensor

any one got the code to use this vex sensor?

Author:  vnguyen [ Tue May 15, 2007 1:15 pm ]
Post subject:  Re: ultrasonic sensor

Solen wrote:
any one got the code to use this vex sensor?


Here's a small sample of code (actually this is taken from the Sample Programs from the latest ROBOTC for IFI release):

Code:
task main()
{
   do                                   
   {
      motor[r_motor] = -75;                  //motor A is run at a 75 power level
      motor[l_motor] = 75;                  //motor B is run at a 75 power level
   }
   while(SensorValue(sonarSensor) > 20);   

}


Just go to "File", "Open Sample Programs"... and go to the "Sonar" folder, then open the "sonar_distance" program.

Author:  Solen [ Wed May 16, 2007 9:22 am ]
Post subject: 

thx but wat slots does the the sensor go into cuz there are two wires :idea:

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/