To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 2942
2941  |  2943
Subject: 
Re: Expression limitations w/bytecode
Newsgroups: 
lugnet.robotics
Date: 
Tue, 19 Jan 1999 01:04:01 GMT
Viewed: 
1250 times
  
In article <13987.52974.46098.504927@perdix.acsu.buffalo.edu>, "Matthew D.
Stock" <stock@perdix.acsu.buffalo.edu> wrote:

As I understand it, the bytecode interpreter doesn't allow you to do fairly
simple things like subtract two variables from each other.  That makes
doing comparisions between sensors somewhat challenging if you want to know
the magnitude of the difference.


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 issues, not arithmetic limitations.

--
reply to: dbaum at enteract dot com



Message has 1 Reply:
  Re: Expression limitations w/bytecode
 
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 (...) (26 years ago, 19-Jan-99, to lugnet.robotics)

Message is in Reply To:
  Expression limitations w/bytecode
 
As I understand it, the bytecode interpreter doesn't allow you to do fairly simple things like subtract two variables from each other. That makes doing comparisions between sensors somewhat challenging if you want to know the magnitude of the (...) (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

 
Verified and Trusted Team of Hackers
3 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR