To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.org.us.laflrcOpen lugnet.org.us.laflrc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Organizations / United States / LafLRC / 93
    #define-ing stuff for Chibots —Steve Hassenplug
   (...) I'm not totally sure about this, but try playing around with #define In one language I use, the compiler will totally take out the variable, and put in the defined value, before compiling the program. I assume that's how it should work in C (...) (19 years ago, 3-Oct-05, to lugnet.org.us.laflrc)
   
        Re: #define-ing stuff for Chibots —Brian Davis
     (...) I have, and it helps a lot. For instance, when comparing the raw light sensor values to some limit, I #define "<" to be "LIGHTER_THAN", for instance. That makes switching all those points very easy in the code, I need only change two #defines (...) (19 years ago, 3-Oct-05, to lugnet.org.us.laflrc)
   
        Re: #define-ing stuff for Chibots —Kevin L. Clague
   (...) Or a different way #define BLACKLINE 1 #if BLACKLINE #define SEELINE(reading,threshold) reading < threshold #else #define SEELINE(reading,threshold) reading > threshold #endif if (SEELINE(s1,threshold1)) { // s1 is on the line } else { // s1 (...) (19 years ago, 8-Oct-05, to lugnet.org.us.laflrc)
 

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