View Single Post
  #1   Spotlight this post!  
Unread 14-02-2004, 13:28
Ian W. Ian W. is offline
College? What?
no team (Gompei and the Herd)
Team Role: College Student
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Worcester, MA | Smithtown, NY
Posts: 1,464
Ian W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to allIan W. is a name known to all
Send a message via AIM to Ian W.
Conditional #define Statements

I'm rewriting the navigate.c class for our team, and I've come to an annoying problem.

I have two sensors, left and right, for each side of the robot. Depending on a switch, only one should be read. That means I can save on code, I think.

With PBASIC, a simple if statement and alias command would set "sensor" to "left_sensor" or "right_sensor" but I have no idea how to do this in C, without going into pointers (which I don't remember).

Is there any way I can make a conditional #define (or similar) statement?
__________________
AIM --> Woloi
Email --> ian@woloschin.com