   Serial.println(bloodOx);
 }
 
+// Changes which LED to shine
 void change_led_type()
 {
     if(state_diag)

red_state = false;
ir_state  = true;
state_diag  = true; // Init state
//ir_timer.start();
change_led_timer.start();
//change_ir_timer.start();
//call_connect_timer.start();
}

void loop() {
    // red_led_on and start red_timer
    if(red_state)
    {
       read_red_and_calc();
       red_state  =  false;
       ir_state   =  false;
    }

    if(ir_state)
    {
      read_ir_and_calc();
      red_state = false;
      ir_state  = false;
    }
    //else
    //{
      // do nothing
    //}
} // loop

void red_led_on()
{
  digitalWrite(LEDIR, LOW); digitalWrite(LEDRed, HIGH);
}

void ir_led_on()
{
  digitalWrite(LEDRed, LOW); digitalWrite(LEDIR, HIGH);
}

void read_red_and_calc()
{
  ir_led_on();
  sensorVoltage = analogRead(InputPin);

    state_diag  = !state_diag;
}

#endif
