Initialization of I/O

hi all-

Thanks for all of your help so far. This is my first Arduino project, and I am just running through the bases and making sure I have done everything the way that the board expects.

Here is a sample of my initialization of variables and I/O. I have looked at the examples to figure out how to do this, and since some of them differ in the way they are expressed, I picked a slightly strange combination of those to do mine.

My big question is, is there anything WRONG with the way that I'm doing this? Specifically just the syntax..

int task0;                          // Task Sensors  
int task1;
int task2;
int task3;
int task4;
int task5;  
int contact1;                     // Contact Sensors
int contact2;

void setup() {

pinMode(19,INPUT);           // Task Sensors
pinMode(20,INPUT);
pinMode(21,INPUT);
pinMode(22,INPUT);
pinMode(23,INPUT);
pinMode(24,INPUT);
pinMode(25,INPUT);           // Contact Sensors
pinMode(26,INPUT);
}

void loop() {

  int task0 = digitalRead(19);                // Task Sensors  
  int task1 = digitalRead(20);
  int task2 = digitalRead(21);
  int task3 = digitalRead(22);
  int task4 = digitalRead(23);
  int task5 = digitalRead(24);
  int contact1 = digitalRead(25);            // Contact Sensors
  int contact2 = digitalRead(26);

  // Init routine..
  if (contact1 == 1 && contact2 == 1) {
     //Read sensors 
     // 
     // etc etc...

   }
}

Not the syntax specifically but you really should learn more about loops and arrays.

You have two lots of task variables. So in the loop miss out the int bit as that creates a new variable. Alternatively if you don't want them to be global leave the loop as it is and remove the definitions outside the loop.