Page 1 of 1

BricxCC Motor Help

Posted: 08 Feb 2011, 05:10
by pesso
This may sound like a really stupid question, but how to go forward until a variable is true?

--Pesso/Clen

Re: BricxCC Motor Help

Posted: 08 Feb 2011, 05:49
by mattallen37
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);
}

Re: BricxCC Motor Help

Posted: 08 Feb 2011, 16:44
by afanofosc
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

Re: BricxCC Motor Help

Posted: 08 Feb 2011, 23:06
by pesso
Thanks! You guys are awesome!

All I was doing was going forward until the US sensor > 6.

And BTW, I am using NXC.

- -pesclen