Changes between Version 1 and Version 2 of arduino/software/cmdline


Ignore:
Timestamp:
Mar 15, 2010, 5:12:55 PM (15 years ago)
Author:
Jürgen Berwein
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • arduino/software/cmdline

    v1 v2  
    1 = Compiling an Arduino project on the command line  =
    2 By default the Arduino package comes with a simple IDE to edit, compile and upload code to the controller. For small projects this editor gives you a reasonable amount of comfort and features. When editing larger source code the editor becomes annoying. You start to which that you can easily use your favorite editor and compile and upload the produced code the way you are used to it, over the command line. 
     1= Compiling an Arduino project on the command line =
     2By default the Arduino package comes with a simple IDE to edit, compile and upload code to the controller. For small projects this editor gives you a reasonable amount of comfort and features. When editing larger source code the editor becomes annoying. You start to which that you can easily use your favorite editor and compile and upload the produced code the way you are used to it, over the command line.
    33
    4 = Download and install the latest (working) Ardunio  =
    5 Download and install the latest package either from your distribution repository or directly from the [http://arduino.cc/en/Main/Software Arduino] page. Remember where the installation path is. 
     4= Download and install the latest (working) Ardunio =
     5Download and install the latest package either from your distribution repository or directly from the [http://arduino.cc/en/Main/Software Arduino] page. Remember where the installation path is.
    66
    77= Create a Project =
     
    1212mkdir PROJECT_NAME
    1313}}}
    14 The PROJECT_NAME has to be the same name as the main source code file which includes the setup and loop functions. Then you have to copy two files to that directory. First the Makefile which you can download here.
     14The PROJECT_NAME has to be the same name as the main source code file which includes the setup and loop functions. Then you have to copy two files to that directory. First the Makefile which you can download below.
    1515
    1616A key point that was hard to figure out, was that the Arduino needs to be reset right before a program is uploaded. This is automatically done by the IDE, but not by the Makefile. If this is not in place, you’ll get error messages like:
    17 
    1817
    1918{{{
     
    2221or
    2322
    24 
    2523{{{
    2624avrdude: stk500_getsync(): not in sync: resp=0x16
    2725avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x34
    2826}}}
    29 to fix this, create a python script like below and place it either somewhere your $PATH is pointing or simply right into your project directory and make it executable 
     27to fix this, create a python script like below and place it either somewhere your $PATH is pointing or simply right into your project directory and make it executable. The script can also be downloaded from the link at the bottom of this pace.
    3028
    3129{{{
    3230chmod u+x pulsedtr.py
    3331}}}
    34 
    3532{{{
    3633import serial
     
    5855Now you can start editing your program file. Save it and compile it by type '''make '''and upload it to your board by '''make upload''' at the command line.
    5956
     57'''Attention! '''To include libraries from Arduino you have to prepend the path to the included header file started from /install/path/of/arduino/hardware/libraries/
     58
    6059Thats it!