Hex file is needed for simulation and when you use separate programmer to program your microcontroller. In this tutorial we will see how to get hex file in Arduino IDE?
Steps to Get Hex File in Arduino IDE
These steps are applicable to all Arduino versions to get hex file.
Step 1: Open your arduino Software.
Step 2: Open any example code or write your own code.
Step 3: Save your program.
Step 4: Click on File >> Preferences (Shortcut key: Ctrl+Comma)
Step 5: Enable verbose mode for compilation by ticking option as shown below
Show verbose output during: [ _/ ] Compailation
Step 6: Compile code you will see HEX file path as shown below for our example blink code
Step 7: Copy folder path and paste it in Run Start>>Run (Short cut Windows+R)
You can use windows explorer also.
Step 8: You will see your hex file in that temporary folder
Step 9: Copy and paste this file to other location. If you need it afterwords. Temporary folder path changes when you close your Arduino IDE. That’s it…
This way you can get hex file in arduino it is very useful for simulation in Proteus you can find tutorial to add arduino library in Proteus here.