It can be handy to write code in arduino’s IDE because it allows you to both share with others and easiely check forums for how to do stuff. However, arduinos are both expensive and large. I prefer to work with the atmega328p on its own instead of including the rest of the arduino with it. I found myself wanting to move some of my projects from arduinos to more a permanent atmega chip. Most people would suggest burning the arduino bootloader to burn your files to the microcontroller. I am going to suggest an alternate way to do this. I am not the first to do this, and I wouldn’t have figured it out without the help of other online forums. Anyways, the process will be to find the *.hex file for the arduino code and then use avrdude to upload it that way. Here is where to find the hex file:
The parts in bold above are what you would change to match your username and the particular build name it generates. If you just sort the Temp directory by date, you can locate the newest folder generated with the prefix buildXXXXXX…. and open that and then find the hex file in that folder. (I should point out that you will want to have hidden directories showing if you want to navigate to that folder)
At this point you can use whatever method you use normally to upload the hex file. I use avrdude. You can move that hex file out of the folder and put it wherever you want, or you can cd to that directory, or you can input the full path to that file in avrdude. Any way works.
I am very glad to have found where the Arduino IDE makes the hex files to. Hopefully this helps spread the idea!