To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 2103
2102  |  2104
Subject: 
Re: legOS codeI need example code of rcx2rcx communication.
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 30 Oct 2001 21:39:30 GMT
Viewed: 
1623 times
  
In lugnet.robotics.rcx.legos, Chris Daniel writes:
Albert, Thanks for responding to my post! I had trouble compileing the code
maybe you could help or e-mail me the original.Thanks here is the error report:
brick1.c: In function `read_from_ir':
brick1.c:40: warning: passing arg 1 of `memcpy' di
rget type
brick1.c: In function `main':
brick1.c:56: `data' undeclared (first use in this
brick1.c:56: (Each undeclared identifier is report
brick1.c:56: for each function it appears in.)
brick1.c:49: warning: unused variable `i'
brick1.c:48: warning: unused variable `buf'
make: *** [brick1.o] Error 1

Chris,

First, I think the code in the main function should be as follows:

int main( int argc, char* argv[] )
{
   char buf[256];
   int len;          //notice the variable i is missing

   lnp_address_set_handler( 1, port_handler );

   while(1) {
     len = read_from_if( buf );   //notic variable buf is used instead of data
     if (buf[0] == '!') {
       dsound_play( notes_short );
     }
   }
}

Second, the argument for the read_from_ir( ) function needs to be:
int read_from_ir( unsigned char* data); //notices not const anymore

This change will allow the memcpy to work correctly.

HTH,

Bill



Message is in Reply To:
  Re: legOS codeI need example code of rcx2rcx communication.
 
Albert, Thanks for responding to my post! I had trouble compileing the code maybe you could help or e-mail me the original.Thanks here is the error report: brick1.c: In function `read_from_ir': brick1.c:40: warning: passing arg 1 of `memcpy' di rget (...) (23 years ago, 29-Oct-01, to lugnet.robotics.rcx.legos)

7 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