This may sound like a really stupid question, but how to go forward until a variable is true?
--Pesso/Clen
BricxCC Motor Help
BricxCC Motor Help
51st Member Of MindBOARDS! (well, that's that the member's list says)
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: BricxCC Motor Help
What language? In NXC, I would do something like the following.
Code: Select all
int variable;
task main(){
OnFwd(OUT_A,100);
until(variable==1);
Off(OUT_A);
}
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: BricxCC Motor Help
Something like what Matt posted except maybe you would want the variable value to actually be modified somewhere in your code. If you give us a bit more information about what you have in mind then we can make more specific suggestions.
John Hansen
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: BricxCC Motor Help
Thanks! You guys are awesome!
All I was doing was going forward until the US sensor > 6.
And BTW, I am using NXC.
- -pesclen
All I was doing was going forward until the US sensor > 6.
And BTW, I am using NXC.
- -pesclen
51st Member Of MindBOARDS! (well, that's that the member's list says)
Who is online
Users browsing this forum: Semrush [Bot] and 2 guests