compile arduino file using command line(windows)

Hi,

I want to compile the arduino file(.ino) using command line from windows platform. Please anybody tell the procedure for doing this.

Actually I have to automate the Arduino programming using Labview. I want to compile and create hex files from command line( I am using windows 7). so that once Hex files are created, I can upload that files into the board from labview.

Here you go:

Let us know if you run into any problems.

Thank you for your reply..

When I enter this command in command line, arduino /"C:/Users/Wiot_Lab/Documents/labview/arduino/Blink/Blink.ino" , I am getting this message "arduino" is not recognized as an internal or external command, operable program or batch file.

Do I need to install any software before using this commands in command line? or will it support in windows?

PrakashSp:
Do I need to install any software before using this commands in command line? or will it support in windows?

You need to install the Arduino IDE, which you can download from:
http://www.arduino.cc/en/Main/Software
Note that I mean the real Arduino IDE, not Arduino Web Editor.

Note that on Windows you should use the command arduino_debug instead of arduino.

I have installed Arduino IDE 1.8.5 version.

when I use arduino_debug command, now also I am getting the same message "arduino_debug" is not recognized as an internal or external command, operable program or batch file.

You need to do one of the following:

  • Specify the full path to the arduino_debug executable.
  • Run the command from the Arduino IDE installation folder.
  • Add the Arduino IDE installation folder to your PATH environment variable.

How to add PATH environmental variable?

https://www.java.com/en/download/help/path.xml

When I run the commands from Program files/Arduino folder It is working...

Thank you very much..... :slight_smile:

Thanks for your replies......

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per

FWIW I recently wrote a little wrapper, ardi, around arduino-cli that lets you compile, upload, and read logs from the serial port from command line with a bit more ease. It attempts to automatically detect your board and has an option to watch a sketch file and auto re-compile / re-upload on save. Feel free to use it if you find it helpful in anyway :slight_smile: