View unanswered posts | View active topics It is currently Wed Aug 20, 2014 12:52 am






Reply to topic  [ 2 posts ] 
Cleaning Robot 
Author Message
Rookie

Joined: Wed Dec 02, 2009 2:34 pm
Posts: 1
Post Cleaning Robot
This is my first project using RobotC. My robot is a cleaning robot. When it senses a white piece of paper, it will move from side to side and "clean" that piece of paper. Once it is done cleaning, it will keep driving around until it finds another piece of white paper, and it will clean it too. It will continue to do the same thing over and over until you stop it.

Code:
#pragma config(Sensor, S2,     lightSensor,         sensorLightActive)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
   while(true)
   {
          while(SensorValue(lightSensor) < 30)
          {
          motor[motorC] = 50;
          motor[motorB] = 50;
          }
      int i; // This creates a variable and gives it a name 'i'.
      for(i = 0; i < 4; i++) // This sets the conditions of the loop.
       {
       motor[motorB] = 100;
       motor[motorC]= -100;
       wait1Msec (500);
       motor[motorB] = -100;
       motor[motorC] =  100;
       wait1Msec (500);
      }
  }
}


Here is a video of my robot:
http://www.flickr.com/photos/29464331@N02/4117559442/in/set-72157608737193431/


Last edited by ccamp01 on Wed Dec 09, 2009 2:36 pm, edited 1 time in total.



Wed Dec 02, 2009 3:18 pm
Profile
Online
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3187
Location: Rotterdam, The Netherlands
Post Re: Cleaning Robot
That sounds like something my wife would like me to build to clean up the mess on my Lego table. Do you have a video of this cleaning robot? It would really make it more vivid for people when they can see a photo or a short video. Just put it on YouTube :)

Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Dec 02, 2009 5:07 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 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.