Stops at 1778 bytes without errors

Hello all.

First off, i wish everyone a happy new year!

For the last years i have been developing a amplifier, and now im in the final stages creating the MCU unit that consists of a Arduino Mega board with a lot of (amplifier)safety features connected to it. Now, there is nothing wrong with the board it self, the error lays in my programming skills so i hope someone would be so kind to help me fix this issue. For some reason when im verifying the program, it ends up finished with a result of: Binary sketch size: 1 778 bytes
However, there is no way that this size is correct, and it does not function on the arduino unit at all. Ive created a smaller program just to do a check, with this simple program everything is running as it should(although no security features is actived with that program) and even this program is bigger around 2200 bytes.

Check the file attached to this post, if was to big to be pasted here.

Anyone have some input for me? Thanks.

Hovedkort.ino (12.9 KB)

Away from PC but on tablet, so cannot compile your attachment. But... Maybe it is an SRAM issue...

Flash is one issue but SRAM usage is another as some libraries make harsh demands on it... For Win, iOS, Linux, you can post-process the .elf created by a compile:


Thanks for your response mrburnette. Issue was way simpler than that, there have been some years since i last used arduino, and have forgot alot of things. Among them using a integrer when picking up a state. I had them like this "digitalRead(dittobutton)" instead of "dittostate = (digitalRead(dittobutton)"... It sure did seem like it helped to fix this issue, i will have another test with the board now. Anyways, if anyone have some suggestions to changes to the script that is better let me know

I don’t know whether 1778 bytes is reasonable, I could verify the result.
But I got a lot of compiler warnings:

Hovedkort.ino:392: warning: statement has no effect

Try fixing that first

Function typing. You have a number of functions of type int that have no return. Should they be type void?