View unanswered posts | View active topics It is currently Thu Aug 16, 2018 8:39 am






Reply to topic  [ 1 post ] 
Line Following avoiding obstacles Project! Somebody help me! 
Author Message
Rookie

Joined: Fri Apr 22, 2016 11:32 pm
Posts: 3
Post Line Following avoiding obstacles Project! Somebody help me!
Attachment:
legomindstrom.jpg
legomindstrom.jpg [ 66.02 KiB | Viewed 4779 times ]
I'm working on a project (Line Following avoiding obstacles Project) but it kinda really tricky cause I am new to this programming...

I have searched for many things bout how to make robotc program for day and day... I realized its not easy for me to do this... thats why I came here for some help

I will be appreciated if you give me a hand !!! PLZ !!

here is my code and this code is for an attachment that I need to finish




task main()
{

nMotorEncoder[rightMotor] = 0;
nMotorEncoder[leftMotor] = 0;

while(nMotorEncoder[leftMotor] < 500)
{
motor[rightMotor] = 50;
motor[leftMotor] = 50;
}
motor[rightMotor] = 0;
motor[leftMotor] = 0;
wait1Msec(2000);

int threshold = 50;

if(SensorValue(left_light) < 50)
{
if(SensorValue(right_light) > 50)
{
motor[leftMotor] = 0;
motor[rightMotor] = 40;
}
else
{
motor[leftMotor] = 50;
motor[rightMotor] = 50;
}
}

while(SensorValue(sonar) > 10
{
motor[rightMotor] = 55;
motor[leftMotor] = 55;
}

motor[rightMotor] = 0;
motor[leftMotor] = 0;
wait1Msec (1000);

motor[rightMotor] = -20;
motor[leftMotor] = -20;
wait1Msec(500);

motor[rightMotor] = -40;
motor[leftMotor] = 40;
wait1Msec(1500);

motor[rightMotor] = 0;
motor[leftMotor] = 0;
wait1Msec(1000);

nMotorEncoder[rightMotor] = 0;
nMotorEncoder[leftMotor] = 0;

while(nMotorEncoder[leftMotor] < 3000)
{
motor[rightMotor] = 50;
motor[leftMotor] = 50;
}
motor[rightMotor] = 0;
motor[leftMotor] = 0;
wait1Msec(2000);
}


Attachments:
legomindstrom.jpg
legomindstrom.jpg [ 66.02 KiB | Viewed 4779 times ]
Sat Apr 23, 2016 3:26 am
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:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.