View unanswered posts | View active topics It is currently Sat Aug 23, 2014 1:35 pm






Reply to topic  [ 3 posts ] 
ultrasonic sensor 
Author Message
Rookie

Joined: Tue May 15, 2007 1:01 pm
Posts: 10
Post ultrasonic sensor
any one got the code to use this vex sensor?


Tue May 15, 2007 1:05 pm
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:44 am
Posts: 439
Location: Pittsburgh, PA
Post 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.

_________________
Vu Nguyen
Software Training Development Team | Webmaster
Need more support? Use the ROBOTC Ticketing system

Robotc.net| Robomatter Store | Robotics Academy | CS2N


Tue May 15, 2007 1:15 pm
Profile
Rookie

Joined: Tue May 15, 2007 1:01 pm
Posts: 10
Post 
thx but wat slots does the the sensor go into cuz there are two wires :idea:


Wed May 16, 2007 9:22 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.