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

1st Program- Dog
http://www.robotc.net/forums/viewtopic.php?f=15&t=2027
Page 1 of 1

Author:  erueda1 [ Wed Dec 09, 2009 2:39 pm ]
Post subject:  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/

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