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 / 1505
1504  |  1506
Subject: 
Difficulty Activating Sensors in v0.2.4
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 6 Nov 2000 20:06:33 GMT
Viewed: 
1299 times
  
I'm using LegOS 0.2.4 on Windows 2000 (Cygwin solution).

I receive errors when I try to compile any code that activates a sensor.
I've looked at both old references and new as well as the old Dave Baum
book.  At first, I thought it may just be the rotation sensor but I tried it
with the light sensor and get the same results.  Therefore, I now expect the
user.  :-)
In Dave Baum's first book he mentioned declaring passive senor too.  I tried
to be explicit with the touch sensor and got more errors.  If I don't
declare it and just use it, I'm OK.

I include dsensor.h and use commands ( XXX: is the line number )
120: ds_active(&SENSOR_3);
121: ds_rotation_on(&SENSOR_3);
122: ds_rotation_set(&SENSOR_3, 0);

The errors I receive for all three line numbers above are:
  parse error before `&'
  warning: type defaults to `int' in declaration of [`ds_active',
     ds_rotation_on', 'ds_rotation_set']
  conflicting types for [`ds_active', etc.]
  previous declaration of [`ds_active', etc.]  (It also includes the line
     number in the header file -- 129, 163, 157 -- where it conflicts)
  warning: data definition has no type or storage class

Any thoughts and/or suggestions?

Thank you,

-- Gary Mayer



Message has 3 Replies:
  Re: Difficulty Activating Sensors in v0.2.4
 
(...) Which Cygwin solution? i.e., what version of gcc? (to check, run gcc --version) (...) All that code looks perfectly fine to me. In fact, it looks like it matches line by line that I compiled yesterday with no problem. Could you post the entire (...) (24 years ago, 6-Nov-00, to lugnet.robotics.rcx.legos)
  Re: Difficulty Activating Sensors in v0.2.4
 
(...) Warnings tell, that lines 120,etc are the declaration part of the program and you just redeclare ds_active and similiar functions. My advice is to look for a missing or redundant brace before these lines. -- Marek mbrudka@elka.pw.edu.pl (24 years ago, 6-Nov-00, to lugnet.robotics.rcx.legos)
  Re: Difficulty Activating Sensors in v0.2.4
 
(...) You have to use the commands inside of a method, e.g. in the main method. I just tried it and get the exactly the same error messages if I don't put these calls inside a method. If you think you put them in a method, make sure that you don't (...) (24 years ago, 7-Nov-00, to lugnet.robotics.rcx.legos)

5 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