Subject:
|
Re: Expression limitations w/bytecode
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 19 Jan 1999 02:33:15 GMT
|
Original-From:
|
Matthew D. Stock <stock@=AvoidSpam=perdix.acsu.buffalo.edu>
|
Viewed:
|
1278 times
|
| |
| |
Dave Baum writes:
> The firmware does support basic arithmetic operations. You can use them
> in NQC like this...
Ah, my mistake. I had tried something like "if (a - b > 20)" using NQC,
and it failed. I referred to the docs, and my read of the expression stuff
seemed to tell me that something like you describe wasn't valid. I had
interpreted "var -= value" to mean that you could add and subtract
constants, but not other variables.
I'm better now. :-)
Thanks again!
-Matt
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics
|
|
Message has 1 Reply: | | Re: Expression limitations w/bytecode
|
| One more note on arithmetic... The firmware supports operations where the second operand is either a constant or a variable, but not other sources (such as input values, timers, etc). Present versions of NQC don't check this, so code like "a -= (...) (26 years ago, 19-Jan-99, to lugnet.robotics)
|
Message is in Reply To:
| | Re: Expression limitations w/bytecode
|
| (...) The firmware does support basic arithmetic operations. You can use them in NQC like this... int a, b; task main { a = IN_1; b = IN_1; b -= a; } Dave p.s. As a side note, NQC does not support stuff like "a=b+c", but this is due to concurrency (...) (26 years ago, 19-Jan-99, to lugnet.robotics)
|
7 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|