user39104: I currently have a .ino firmware file that I use in the Arduino IDE to program an ATmega328 micro-controller. I would like to get the file that the Arduino IDE uses to program the micro-controller.
Probably the IDE uses a hexadecimal (hex) file or something and sends it to the micro-controller through the serial.
How can I get this file being the only file that the IDE generates is the .ino?

user26916: The easiest way to get the file is:

Sketch > Export Compiled Binary
Wait for the compilation process to finish
Sketch > Show Sketch Folder

You will find an extra file in the sketch folder, which in this case will have a .hex extension. This is the compiled file which would normally be uploaded to the Arduino board via Sketch > Upload.
Note that the "Export Compiled Binary" feature is only available from Arduino IDE 1.6.5 and newer.

user2881: In the Preferences of the Arduino IDE; after Show verbose output during: check the box next to compilation.
Then when you compile you should get something like this at the bottom of the window:
...
...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy" -O ihex -R .eeprom  "/var/folders/tp/grrlc56j3z7057f12_7f1_0r0000gn/T/arduino_build_635063/Blink.ino.elf" "/var/folders/tp/grrlc56j3z7057f12_7f1_0r0000gn/T/arduino_build_635063/Blink.ino.hex"
Sketch uses 928 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

At the end of the third line from the bottom you get the .hex filename. In this case (on OSX) that would be /var/folders/tp/grrlc56j3z7057f12_7f1_0r0000gn/T/arduino_build_635063/Blink.ino.hex

user19409: You are asking how to locate the compiled hex file. It's easy! Follow these steps:

In the Arduino IDE select Sketch > Export Compiled Binary. This performs a compile. Once complete, this command places a copy of the compiled .hex file into the directory of your sketch.
 
Then either browse to the sketch folder or in the IDE select Sketch > Show Sketch Folder.
 

This generates two hex files for the target micro-controller; one with the bootloader and one without the bootloader. These hex files can be uploaded to the micro-controller using a programmer such as the Atmel Ice or AVRISPmkII.

39104: <p>I currently have a <code>.ino</code> firmware file that I use in the Arduino IDE to program an ATmega328 micro-controller. I would like to get the file that the Arduino IDE uses to program the micro-controller.</p>

<p>Probably the IDE uses a hexadecimal (hex) file or something and sends it to the micro-controller through the serial.</p>

<p>How can I get this file being the only file that the IDE generates is the <code>.ino</code>?</p>
 26916: <p>The easiest way to get the file is:</p>

<ol>
<li>Sketch > Export Compiled Binary</li>
<li>Wait for the compilation process to finish</li>
<li>Sketch > Show Sketch Folder</li>
</ol>

<p>You will find an extra file in the sketch folder, which in this case will have a <code>.hex</code> extension. This is the compiled file which would normally be uploaded to the Arduino board via <strong>Sketch > Upload</strong>.</p>

<p>Note that the "Export Compiled Binary" feature is only available from Arduino IDE 1.6.5 and newer.</p>
 2881: <p>In the Preferences of the Arduino IDE; after <code>Show verbose output during:</code> check the box next to <code>compilation</code>.</p>
<p>Then when you compile you should get something like this at the bottom of the window:</p>
<pre><code>...
...
&quot;/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy&quot; -O ihex -R .eeprom  &quot;/var/folders/tp/grrlc56j3z7057f12_7f1_0r0000gn/T/arduino_build_635063/Blink.ino.elf&quot; &quot;/var/folders/tp/grrlc56j3z7057f12_7f1_0r0000gn/T/arduino_build_635063/Blink.ino.hex&quot;
Sketch uses 928 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
</code></pre>
<p>At the end of the third line from the bottom you get the <code>.hex</code> filename. In this case (on OSX) that would be <code>/var/folders/tp/grrlc56j3z7057f12_7f1_0r0000gn/T/arduino_build_635063/Blink.ino.hex</code></p>
 19409: <p>You are asking how to locate the compiled hex file. It's easy! Follow these steps:</p>

<ol>
<li>In the Arduino IDE select <code>Sketch</code> > <code>Export Compiled Binary</code>. This performs a compile. Once complete, this command places a copy of the compiled <code>.hex</code> file into the directory of your sketch.<br>
<a href="https://i.stack.imgur.com/tO9jj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/tO9jj.png" alt="Export Compiled Binary"></a>  </li>
<li>Then either browse to the sketch folder or in the IDE select <code>Sketch</code> > <code>Show Sketch Folder</code>.<br>
<a href="https://i.stack.imgur.com/dTRLr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dTRLr.png" alt="Show Sketch Folder"></a>  </li>
</ol>

<p>This generates two hex files for the target micro-controller; one with the bootloader and one without the bootloader. These hex files can be uploaded to the micro-controller using a programmer such as the Atmel Ice or AVRISPmkII.</p>
