To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1112
1111  |  1113
Subject: 
What are Opcodes for ...
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Thu, 3 May 2001 17:49:58 GMT
Viewed: 
1967 times
  
hi All, (specially Dave)

I'm building a realtime graphical viewer ,like Michael Gasperi's Mr. Sensor, but with more possibilities (see
  http://baserv.uci.kun.nl/~smientki/Lego_Knex/Lego_electronica/Mindscope.htm
My goal is to get an 100 Hz througput from RCX to PC.
At this moment I've reached 40 Hz, and the main bottleneck seems to be the baudrate of 2400 Hz.
So I think I'll reach 100 Hz with 4800 Baud and some other minor modifications.

SetSerialComm()
SetSerialPacket()
SetSerialData()
SendSerial()

and the constant values used in these opcodes.

I use the following NQC program, which I want to adept dynamically by the program according to the selected signals:
----------------------
task aap()
{
int x;
  SetSerialComm(SERIAL_COMM_DEFAULT);
  SetSerialPacket(SERIAL_PACKET_DEFAULT);

  SetSerialData(0,0xAA);
  repeat (100)
  {
    x=SENSOR_1;
    SetSerialData(1,(x & 0x7F));
    SetSerialData(2,((x / 128) & 0x7F));
    x=SENSOR_2;
    SetSerialData(3,(x & 0x7F));
    SetSerialData(4,((x / 128) & 0x7F));
    SendSerial(0,5);
  }
}
-------------------

best regards
Stef Mientki



Message has 1 Reply:
  Re: What are Opcodes for ...
 
There's a good document in the Lego SDK that explains all of the opcodes. If you want to see which opcodes particular NQC instructions are using, just generate a code listing with the -l option. Then refer to the Lego documentation for the format of (...) (23 years ago, 3-May-01, to lugnet.robotics.rcx.nqc)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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