RobotC Help

Lego Mindstorms Discussions - Lego Mindstorms Disucssions 

Bookmark this page:  YahooMyWeb Yahoo!  Google Google  Windows Live Favorites Windows Live  del.icio.us del.icio.us  digg digg  Add to Netscape Netscape
Subject Author Date
RobotC Help yanjchan 08-12-2006
If you were  Registered and logged in, you could reply and use other advanced thread options
Posted by yanjchan on August 12, 2006, 9:27 pm
Hi, I am using robotc,
I made a program and could somebody tell me why it is not working?

const tSensors touchSensor = (tSensors) S1;
const tSensors soundSensor = (tSensors) S3;
const tSensors lightSensor = (tSensors) S2;

task main()
{
    while(SensorValue(touchSensor) == 0) //loop while the touch sensor is
not pressed
    {
        motor[motorB] = 100;
        motor[motorC] = 100;
    }                                                    //exit loop when touch sensor is pressed


     while(SensorValue(soundSensor) >20) //loop while the sound sensor
is not activated
    {
        motor[motorB] = 0;
        motor[motorC] = 0;
     motor[motorA] = 0;
     }



//close claw


motor[motorA] = 75;
wait1Msec(500);


//turn right


motor[motorB] = 100;
wait1Msec(2000);



     while(SensorValue(lightSensor) <50) //loop while the light
sensor is less then 50
    {
        motor[motorB] = -100;
        motor[motorC] = -100;
    }



//open claw



motor[motorA] = -75;
wait1Msec(500);



}

all the robot does is sit there!



The site map in XML format XML site map
other useful resources:
Official Robosapien Website
Lego Mindstorms Website

Contact Us | Privacy Policy