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 / 3840
3839  |  3841
Subject: 
Re: Can C See?
Newsgroups: 
lugnet.robotics
Date: 
Thu, 18 Feb 1999 03:19:38 GMT
Viewed: 
922 times
  
The source to NQC has some classes that take care of all the serial port
protocol stuff (without requiring Spirit.ocx).  You can download the code
from http://www.enteract.com/~dbaum/lego/nqc/index.html

You'll want to use the RCX_Link class.  The following code snippet should
be close to what you need....

RCX_Link link;
RCX_Cmd cmd;
UByte buf[2];

link.Open();
cmd.Set(kRCX_ReadOp, kRCX_VariableType, n); // n = the variable number
link.Send(cmd);
link.GetReply(buf, 2); // read reply data into buf
link.Close();

Of course, you'll probably want to do error checking, etc.  If you
download the code and have trouble getting started, just send me an
e-mail.

Dave


In article <36CB2EFC.6378@sprynet.com>, B@BigB.net wrote:

All I want to do is have a C program check the value
of a variable on the RCX.

Do I have to use Spirite.ocx somehow from C?

Can't I just send some data to the Com port were the Ir tower is?

Or is it a big mess?

(Why does VB work and not C?)


Thanks,
Brandon Yates

--
reply to: dbaum at enteract dot com



Message is in Reply To:
  Can C See?
 
All I want to do is have a C program check the value of a variable on the RCX. Do I have to use Spirite.ocx somehow from C? Can't I just send some data to the Com port were the Ir tower is? Or is it a big mess? (Why does VB work and not C?) Thanks, (...) (25 years ago, 17-Feb-99, to lugnet.robotics)

2 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