With this, building and uploading to arduino is as simple as typing
$ make
$ make upload # this will detect your port automatically (except for windows)
Works on Cygwin, Mac and Linux.
All source code goes into src
folder. Open the makefile and changes the values
of LOCAL_INO_SRCS
(there should be one or zero .ino
file in your project).
Source files have extensions either .cpp
or .c
. Append them to
variable LOCAL_CPP_SRCS
. For example, this sample project has the following:
## INO file and other cpp files
LOCAL_INO_SRCS = $(PROJECT_DIR)/src/eye_blink_main.ino
LOCAL_CPP_SRCS = $(PROJECT_DIR)/src/TriggerImaging.cpp \
$(PROJECT_DIR)/src/Solenoid.cpp \
$(PROJECT_DIR)/src/PhaseChangeRoutine.cpp \
$(PROJECT_DIR)/src/main.cpp \
$(PROJECT_DIR)/src/LocalLibrary.cpp \
$(PROJECT_DIR)/src/LCDRelated.cpp \
$(PROJECT_DIR)/src/Initialize.cpp \
$(PROJECT_DIR)/src/DetectBlinks.cpp \
$(PROJECT_DIR)/src/Globals.cpp \
$(PROJECT_DIR)/src/ChangePhase.cpp
You don't have to change anything else. I've tested is on Mac
and Linux
.
Of-course you need to install arduino. Even if you don't have a board to connect
to, you can still build this project to see if everything is fine. You can use `miniterm.py` (package python-pyserial) to communicate with your serial port.
Open a ticket on repository if something is not working.