I just started using an Arduino board for a personal project due to the simplicity. I have worked with other more complicated MCUs in the past so I figured it would be smooth sailing. However, I ran into a very frustrating issue with the IDE.
I got the latest Arduino IDE and tested it with my Mega 2560 using a little test program. Saw everything was working properly so I started my new project sketch and went to work on it. After working on it for a couple hours, saving diligently, I had to go and do something else. So I made sure to save, and close the IDE properly before leaving. I would have backed the sketch up on my USB stick or drive but there was not that much work anyways and I figured that it would have at least lasted a day. When I got up this morning to work on the sketch a bit, I turned on my laptop and opened my sketch. It was completely blank, no starter code or anything, and there were no errors. I was thoroughly confused so I made sure I wasn't saving it to a different file by accident or have some setting wrong that would make it not display.
Nothing seemed wrong, so I opened up the sketch file in a hex editor to see if there was any data left and it was just 2KB of zeros. The file was bigger than my earlier sketch file (which was still fine) so I know that something went wrong and just wiped the file with all zeros. I cannot explain why this would happen, and it is frustrating since I am not worried about the work lost, it was not very much, but if it will randomly happen again. Knowing my luck, it will be right after big changes and lots of work done right before I back it up lol.
Anyone have a similar experience or know what is going on? The only other things I have found online are people accidentally deleting files but I did not do anything at the end besides save and close the IDE.