View Single Post
  #18   Spotlight this post!  
Unread 06-01-2007, 15:24
Generalx5's Avatar
Generalx5 Generalx5 is offline
Hard Core Inventor
AKA: Jun(John) Zheng
FRC #1346 (Trobotics)
Team Role: Student
 
Join Date: Nov 2005
Rookie Year: 2004
Location: CANADA
Posts: 94
Generalx5 will become famous soon enough
Re: Why it works with an underscore?

It compiles now, but its still not responding to the changes in the sensors. If one of the sensors changed signals and this setting is defined as setting_2 below, it does not change the settings for the solenoids.

This is how im using the codes:


#define Setting_1 solenoid1 = 1;solenoid2 = 0; solenoid3 = 1;solenoid4 = 0; solenoid5 = 0; solenoid6 = 1
#define Setting_2 solenoid1 = 0;solenoid2 = 1; solenoid3 = 0;solenoid4 = 1; solenoid5 = 1; solenoid6 = 0



if ((Senor1 = 1) && (Sensor2 = 1) && (Sensor3 = 1) && (Sensor4 = 1) && (Sensor5 = 1))
{
Setting_1;
}
if ((Senor1 = 1) && (Sensor2 = 1) && (Sensor3 = 1) && (Sensor4 = 1) && (Sensor5 = 0))
{
Setting_2;
}