need help on programing blacklin please hurry

10 replies [Last post]
ryanneedshelp
Title: NooBot
Joined: 04/11/2012
Posts:
BotPoints: 0
User offline. Last seen 10 years 24 weeks ago.

.hello my follow the black line is no longer working please send me a new code not advice on how to fix it. my botball tornament is satuarday so please i do not have time to work on my program.the program is below.

int main()
{

set_each_analog_state(0,0,0,1,0,0,0,0);

printf("follow line\n");

while(analog10(3)<500){// nothing in front

if(analog10(0)<512){//off tape,turn left

mav(0,250);

mav(3,500);//right motor
}

else{//on tape, turn right

mav(0,500);

mav(3,250);//right motor

}

}//object near the front

ao();//stop

printf("stopped\n");

return 0;
}

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 19 weeks ago.

"No longer working" doesn't help us diagnose what's wrong. Please post what the robot is currently doing wrong.

Thanks.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

ryanneedshelp
Title: NooBot
Joined: 04/11/2012
Posts:
BotPoints: 0
User offline. Last seen 10 years 24 weeks ago.

it is sopposed to stay on and follow the black line instead it gos off the line when the black line curves. not to sound rude do not get mad but i just need a new program that works. i have one more day to work on this before botball tonament. you are smart so please help me.

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 19 weeks ago.

Botball is an educational robotics program. No one learns anything if you simply have someone write finished code for you. This forum is for getting help with your code, not outsourcing your code development. Also, I'm a college student, so if I coded something for you, your team would be disqualified, and I would be subject to sanctions. Finally, you did not need to spam 4 forum threads plus 2 user articles in your attempt to outsource your code development. Many people get e-mail notifications about new user articles; they do not appreciate the spam.

Thanks.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

ryanneedshelp
Title: NooBot
Joined: 04/11/2012
Posts:
BotPoints: 0
User offline. Last seen 10 years 24 weeks ago.

can you at least tell me what i need to do.

Beta
Beta's picture
Title: The Magnificent
Joined: 02/24/2012
Posts:
BotPoints: 266
User offline. Last seen 8 years 32 weeks ago.

Ryan,

The issue here is that we don't know what you need to do either. We need a complete diagnosis of what is incorrect with your robot. What you want it to do (which you provided), and what it actually did. You need to run through your code in a systematic way, so we can help you. We need a long message describing every detail.

Posting a message asking for help over and over wastes both our and your time, which it sounds like you do not have much of.

You will not get either Jeremy or myself to write your code for you, no matter how many times or places you ask. We both are very busy, and it is against botball rules for you to do so.

Thanks.

Braden McDorman

Developer of the KIPR Link, KISS IDE, KIPR's 2D Simulator, and CBCJVM.

Reach me at bmcdorman(cat)kipr(dog)org where (cat)=@ and (dog)=. if you need assistance of any kind.

ryanneedshelp
Title: NooBot
Joined: 04/11/2012
Posts:
BotPoints: 0
User offline. Last seen 10 years 24 weeks ago.

made new program but it has errors

void black_line ()
{
float i;
while(1)
{
if(analog10(2)>650)
mav(3,300);
mav(1,-1000);
i = 5.0;

while(analog10(2)<650)
{
mav(3,-1000);
mav(1,300);
while(digital(14))
{
ao();

}
}
}
}

so can you tell me whats wrong

amehta
Title: NooBot
Joined: 07/18/2011
Posts:
BotPoints: 136
User offline. Last seen 5 years 32 weeks ago.

Well for one, your if statement isn't enclosed in "curly brackets" as I call them (The "{" and "}" )...

-amehta (Andrew Mehta)

amehta
Title: NooBot
Joined: 07/18/2011
Posts:
BotPoints: 136
User offline. Last seen 5 years 32 weeks ago.

Also, the flow of the function is sort of off... And like the others have said above, what exactly do you want the program to do and what IS it doing? I assume you're trying to follow a black line until a touch sensor is bumped, but if not, tell me.

I would suggest using an else-if statement, so it would be sort of set up like this:


if (Condition)
{
     Do Something
}
else if (Other Condition)
{
     Do Something
}

Obviously replace the italics with real code that does what you need it to do.

n/a
ryanneedshelp
Title: NooBot
Joined: 04/11/2012
Posts:
BotPoints: 0
User offline. Last seen 10 years 24 weeks ago.

thanks man that is the first real help i got all day.

amehta
Title: NooBot
Joined: 07/18/2011
Posts:
BotPoints: 136
User offline. Last seen 5 years 32 weeks ago.

You're welcome.

Maybe being a little clearer will help next time. Remember, we're here to help you, but we can't do that if we don't understand what you are having trouble with.

-amehta (Andrew Mehta)