title: Strange behavior when compiler converts from float to double
body: <p>I have an array: </p>
  
  <pre><code>float foo[3];
  </code></pre>
  
  <p>In the ino file I have to send one of them to the PID as input. </p>
  
  <pre><code>double output;
  PID myPID(&amp;input, &amp;output, &amp;target, 1, 0.0, 1.1, DIRECT);
  ...
  void loop(){
    input =foo[2];   
    myPID.Compute();
    Serial.print(output); //output: "nan"
  ...
  }
  </code></pre>
  
  <p>The PID is as follow:</p>
  
  <pre><code>PID::PID(double* Input, double* Output, double* Setpoint,
          double Kp, double Ki, double Kd, int ControllerDirection)
  </code></pre>
  
  <p>It compiles but the output of the PID outvalue is nan. </p>
  
  <p>However if I set the input to -1.2 then it works. </p>
  
  <pre><code>void loop(){
        input =foo[2];  
        input = -1.2;
        myPID.Compute();
        Serial.print(output); //output: "1200"
      ...
      }
  </code></pre>
  
  <p>How can I fix this? The compiler should auto convert double the float. As in Mega 2560.
  I have also tried: <code>input =double(foo[2]);</code> without any success.</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <pre><code>  Serial.print(foo[2]);  //Prints -9.2
    foo[2] = -9.2;         // I manually set foo[2] to -9.2  
    xAngle = foo[2];
    xPID.Compute();        //Computes perfectly.
  </code></pre>
  
  <p>I have to add that foo is in a custom library. This is so strange. Anyone got a clue about this?</p>