I believe your question may be answered in the following thread. As @Ric and @rickkas7 explained, if you are using pins D3-D7, they are used by JTAG and are briefly pulled high (D6 low and D4 floats) at startup.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Pin state on reset? | 10 | 3760 | December 6, 2015 | |
| Output state changes while flashing | 7 | 1098 | July 20, 2018 | |
| Unexpected high voltage on digital pins during power shutdown | 7 | 1558 | July 12, 2017 | |
| Stopping D7 LED Blink when New Code Flashed | 4 | 1262 | December 23, 2015 | |
| DIGITAL GPIO start-up glitch | 27 | 9212 | April 30, 2016 |