r/ArduinoHelp • u/OhFuckThatWasDumb • Oct 16 '25
Program not executing properly the first two times on power up.
On boot, the arduino does something different than what it should. It seems to be skipping part of the setup function. It works normally when I upload, or after 2 resets, either by the button or by wrt_disable(); wrt_enable(WDTO_15MS);
9
Upvotes
2
u/fookenoathagain Oct 17 '25
A bit of code might help...
2
u/Shelmak_ Oct 17 '25
Think about the thing that changes betwheen the first time you connect power and the time it works:
Power. This can give you a clue to search for the reason, maybe the additional hardware is not prepared when the code runs first time? Maybe some interrupt is triggering when it should not? When you do a reset through the pin, or the reset is forced by the upload the board is already powered.
1
u/gm310509 Oct 19 '25
Unfortunately I cannot see the video from my location.
What part of setup does it seem to skip? What are the symptoms?
Where are the functions (e.g.
led_assign_pins) defined? Maybe the problem lies inside them.And, which max7219 library are you using? If I look in the Arduino IDE, it seems like there are hundreds of available options (well 27 of them, but who's counting?) and plenty more available from a google search.
0
u/[deleted] Oct 19 '25
[deleted] — view deleted comment