I noticed that recent Arduino IDE cannot properly upload the code to my Mega and Uno boards. The IDE tells you that the uploading process is done.
I think your analysis of the problem is bad. If the IDE tells you that the uploading process, that means the upload was successful. The symptoms you describe sound more like the code was uploaded but is not working as expected.
If you turn on warnings (File > Preferences > Compiler warnings > All), do a compilation, and then check the contents of the black console window at the bottom of the Arduino IDE window you’ll find, among other warnings, this:
C:\Users\per\Desktop\LIFA_Base\LabVIEWInterface.ino:632:41: warning: iteration 7 invokes undefined behavior [-Waggressive-loop-optimizations]
sevenSegmentPins[(i-1)] = command[i];
C:\Users\per\Desktop\LIFA_Base\LabVIEWInterface.ino:629:17: note: containing loop
for(int i=2; i<10; i++)
Here’s the declaration of sevenSegmentPins:
Arrays are zero indexed so your loop tries to write to the ninth element of an array that was sized to only hold 8 elements. That corrupts some random area of memory and could cause all sorts of problems.
Here’s another red flag:
C:\Users\per\Desktop\LIFA_Base\LabVIEWInterface.ino:743:27: warning: 'checksum' may be used uninitialized in this function [-Wmaybe-uninitialized]
checksum += command[i];
C:\Users\per\Desktop\LIFA_Base\LabVIEWInterface.ino:740:17: note: 'checksum' was declared here
unsigned char checksum;
This is why you should always have warnings set to All and always pay attention to the warnings. Also, you should always fix warnings, even when they don’t indicate a problem. The reason is that if you have a ton of inconsequential warnings you won’t want to look through them and so might miss the important ones.