View unanswered posts | View active topics It is currently Fri Apr 19, 2019 8:21 am

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Line Following avoiding obstacles Project! Somebody help me!
Author Message
Rookie

Joined: Fri Apr 22, 2016 11:32 pm
Posts: 3
Line Following avoiding obstacles Project! Somebody help me!
 Attachment: legomindstrom.jpg [ 66.02 KiB | Viewed 6451 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

{

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 [ 66.02 KiB | Viewed 6451 times ]
Sat Apr 23, 2016 3:26 am
Display posts from previous:  Sort by
 Page 1 of 1 [ 1 post ]

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ ROBOTC Applications    ROBOTC for LEGO MINDSTORMS       Third-party sensors    ROBOTC for CORTEX & PIC    ROBOTC for VEX IQ    ROBOTC for Arduino    Robot Virtual Worlds    Multi-Robot Communications    Issues and Bugs Competitions & Partners    Mini Urban Challenge    CS2N Robot Virtual Worlds Competitions       VEX Skyrise Competition 2014-2015       VEX Toss Up 2013-2014       FTC Block Party! 2013-2014    Competitions using VEX - BEST, TSA, VEX, and RoboFest!    FTC Programming    RoboCup Junior and Other ROBOT Competitions Virtual Brick Robotics Discussions    General Discussions    Project Discussions Off-Topic ROBOTC Forum & ROBOTC.net Suggestions/Feedback    ROBOTC Forums Suggestions/Comments    ROBOTC.net Suggestions/Comments       NXT Programming: Tips for Beginning with ROBOTC       VEX Programming: Tips for Beginning with ROBOTC    2013 Robotics Summer Of Learning       VEX Toss Up Programming Challenge       FTC Ring It Up! Programming Challenge    International Forums       Spanish Forums          ROBOTC for MINDSTORMS          ROBOTC for VEX       French Forums          ROBOTC pour Mindstorms          ROBOTC pour IFI VEX       Japanese Forums （日本語のフォーラム）       German Forums    2015 Spring Carnival Event    PLTW (Project Lead The Way)    Robotics Merit Badge    2014 Robotics Academy Summer of Learning