title: " function was not declared in this scope" error when declaring a function in Arduino
body: <p>I wrote a function to control dc motors in my project but keep getting this error when I compile my code.</p>
  
  <pre><code>error: 'mPower' was not declared in this scope
     mPower(leftSpeed, rightSpeed);
  error: a function-definition is not allowed here before '{' token
     void mPower(int m1, int m2){
  error: expected '}' at end of input
   }
  mPower' was not declared in this scope
  </code></pre>
  
  <p>I tried defining &amp; declaring the function before calling it.</p>
  
  <pre><code>void loop() {
  
  mPower(leftSpeed, rightSpeed);
  
  
    void mPower(int m1, int m2){
        // ... some instructions ...
    }
  }
  </code></pre>
  
  <p>What is wrong with my code?</p>