View unanswered posts | View active topics It is currently Thu Dec 18, 2014 1:54 am






Reply to topic  [ 1 post ] 
1st Program- Dog 
Author Message
Rookie

Joined: Tue Nov 17, 2009 11:37 pm
Posts: 1
Post 1st Program- Dog
For this project I made a dog that would wander around until it comes across an object then it would bark and walk back, and turn and do this over.
Code:
#pragma config(Sensor, S1,     sonarLight,          sensorSONAR)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()

{
            while(true)
   {

           while(SensorValue[sonarLight] > 40)

          {
          motor[motorC] = 75;
          motor[motorB] = 75;
          }
      PlaySoundFile("DOG05.rso");
      wait1Msec(500);
         motor[motorC] = -75;
         motor[motorB] = 75;
         wait1Msec(1000);
         motor[motorC] = 75;
         motor[motorB] = 75;
         wait1Msec(500);

   }

}

Here is a link to the video of my robot .

http://www.flickr.com/photos/29464331@N02/4153898170/in/set-72157608737193431/


Wed Dec 09, 2009 2:39 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

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.