 
 // Statemachine State variable and initial value
 byte State = Startup;
+byte variables = Position;
 
 // the cs pin of the version after v1.1 is default to D9
 // v0.9b and v1.0 is default D10

    Serial.println(" Init CAN BUS Shield again");
    delay(100);
  }
  
  State = Startup;
  Serial.println("CAN BUS Shield init ok!");

//  // TIMER SETUP- the timer interrupt allows precise timed measurements of the reed switch
//  //for mor info about configuration of arduino timers see http://arduino.cc/playground/Code/Timer1
//
//  cli();//stop interrupts
//
//  //set timer1 interrupt at 1kHz
//  TCCR1A = 0;// set entire TCCR1A register to 0
//  TCCR1B = 0;// same for TCCR1B\
//  TCNT1  = 0;//initialize counter value to 0
//  // set timer count for 1khz increments
//  OCR1A = 1999;// = (16*10^6) / (1000*8) - 1
//  //had to use 16 bit timer1 for this bc 1999>255, but could switch to timers 0 or 2 with larger prescaler
//  // turn on CTC mode
//  TCCR1B |= (1 << WGM12);
//  // Set CS11 bit for 8 prescaler
//  TCCR1B |= (1 << CS11);
//  // enable timer compare interrupt
//  TIMSK1 |= (1 << OCIE1A);
//
//  sei();//allow interrupts
//  //END TIMER SETUP
  
  Serial.println("Interrupt init ok!");
}

    loadcell_data = loadcell_data | buf[2];
    loadcell_data <<= 8;
    loadcell_data = loadcell_data | buf[3];
    //
    //    if (buf[1] >= 128) {
    //           loadcell_data = loadcell_data - 16777216;
    //    }

    loadcell_data_double = loadcell_data;
    //  loadcell_data_double = loadcell_data_double-4294000000;

    //    Serial.print("Encoder: ");
    //    Serial.println(encoder_data, DEC);

     Serial.print("Loadcell: ");
     Serial.println(loadcell_data_double);
