RobotC Help

 alt.comp.lego-mindstorms    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
RobotC Help yanjchan 08-12-2006
Posted by yanjchan on August 12, 2006, 9:27 pm
Please log in for more thread options
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!


Similar ThreadsPosted
RobotC Help - 2 September 14, 2006, 2:13 am

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

Contact Us | Privacy Policy