user40578: I have 2 questions.

Why we have to put our functions before void loop and void setup into VScode+platformio?
I switched from arduino IDE to VScode+platformio today, when I upload the sketch with platformio into my esp-12, it doesn't work. (It works with arduino IDE)

I have this Warning: src\main.cpp:46:24: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 const byte menuColor = 0XF206;
[EDIT]The problem comes from these lines:
attachInterrupt(digitalPinToInterrupt(enA), enAin, RISING);
attachInterrupt(digitalPinToInterrupt(enB), enBin, RISING);
attachInterrupt(digitalPinToInterrupt(enBtn), enBtnIn, FALLING);




user4143: 
Why we have to put our functions before void loop and void setup into VScode+platformio?

Because that is how C works. The Arduino IDE hides it from you by adding function prototypes at the start of your code.

I switched from arduino IDE to VScode+platformio today, when I upload the sketch with platformio into my esp-12, it doesn't work. (It works with arduino IDE)

const byte menuColor = 0XF206;

That can never work. The value 0x06 will be assigned to menuColor since a byte is only 8 bits.  You need to learn to use data types that are suitable for the values you are trying to store in them.

40578: <p>I have 2 questions.</p>

<ol>
<li>Why we have to put our functions before void loop and void setup into VScode+platformio?</li>
<li>I switched from arduino IDE to VScode+platformio today, when I upload the sketch with platformio into my esp-12, it doesn't work. (It works with arduino IDE)</li>
</ol>

<p>I have this Warning: <code>src\main.cpp:46:24: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 const byte menuColor = 0XF206;</code></p>

<p>[EDIT]The problem comes from these lines:</p>

<pre><code>attachInterrupt(digitalPinToInterrupt(enA), enAin, RISING);
attachInterrupt(digitalPinToInterrupt(enB), enBin, RISING);
attachInterrupt(digitalPinToInterrupt(enBtn), enBtnIn, FALLING);


</code></pre>
 4143: <blockquote>
  <p>Why we have to put our functions before void loop and void setup into VScode+platformio?</p>
</blockquote>

<p>Because that is how C works. The Arduino IDE hides it from you by adding <em>function prototypes</em> at the start of your code.</p>

<blockquote>
  <p>I switched from arduino IDE to VScode+platformio today, when I upload the sketch with platformio into my esp-12, it doesn't work. (It works with arduino IDE)</p>
</blockquote>

<pre><code>const byte menuColor = 0XF206;
</code></pre>

<p>That can never work. The value 0x06 will be assigned to menuColor since a byte is only 8 bits.  You need to learn to use data types that are suitable for the values you are trying to store in them.</p>
