Cannot upload code with Arduino IDE newer than 1.8.5

Hi, I have been using an Arduino code, Labview Interface for Arduino from NI. 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. When you send a serial command to the arduino board, the board will not recognize the serial message. I noticed that this problem could be solved by using Arduino 1.8.4. I am wondering if anyone on this forum had encountered similar problems.

Attached are details of the discussed configuration. The arduino code is also attached.

OS: Win 10

Arduino IDE: Version 1.8.5 or newer versions

Arduino Board: Arduino Mega 2560 and Arduino Uno made by Eelegoo.

LIFA_Base.zip (36.4 KB)

RD92:
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:

int sevenSegmentPins[8];

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.

Hola buenas noches
Soy nueva en esto del Arduino estoy trabajando con mi hija y sus compañeros de clase en el proyecto de piano de frutas pero al tratar de descargar el código de programación del arduino no me deja porque lo baje de una pagina de internet, trato de copiar el codigo que aparece en esta pagina y pegarlo en la aplicacion que baje pero tampoco deja aparece error de compilación.
Ayudenme por favor !!!!