emacsからArduinoを使う話を書いたのはいいのだが,macosxでの話だったのでubuntuにつっこんだらいろいろとやることがありました.
arduinoのpageからlinux用のarduino-0012-linux.tgz をとってきて展開しただけでは使えないので,必要なjava関係とAVRのbuild環境をとってきていれる.
apt-get install avrdude sun-java6-jre sun-java6-fonts sun-java6-plugin gcc-avr avr-libc
そしたらMakefileをcopyする.
~/working-dir/arduino-0012/hardware/cores/arduino/Makefile .
んでubuntuにあわせていろいろ変更.
- シリアルデバイス位置を指定する
- AVR関係のtoolをubuntuのを使うように指定する
- パス修正
そのdiffをはっておく.
$ diff -u Makefile.orig Makefile --- Makefile.orig 2009-01-01 12:44:21.000000000 +0900 +++ Makefile 2009-01-01 12:37:24.000000000 +0900 @@ -35,8 +35,10 @@ # $Id$ TARGET = $(notdir $(CURDIR)) -INSTALL_DIR = /Users/dmellis/Source/arduino/trunk/build/macosx/build/work -PORT = /dev/tty.usb* +## INSTALL_DIR = /Users/dmellis/Source/arduino/trunk/build/macosx/build/work +INSTALL_DIR = $(HOME)/working-dir/arduino-0012 +PORT = /dev/ttyUSB* UPLOAD_RATE = 19200 AVRDUDE_PROGRAMMER = stk500v1 MCU = atmega168 @@ -46,7 +48,8 @@ # Below here nothing should be changed... ARDUINO = $(INSTALL_DIR)/hardware/cores/arduino -AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin +## AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin +AVR_TOOLS_PATH = /usr/bin SRC = $(ARDUINO)/pins_arduino.c $(ARDUINO)/wiring.c \ $(ARDUINO)/wiring_analog.c $(ARDUINO)/wiring_digital.c \ $(ARDUINO)/wiring_pulse.c $(ARDUINO)/wiring_serial.c \ @@ -93,7 +96,7 @@ # Programming support using avrdude. Settings and variables. AVRDUDE_PORT = $(PORT) AVRDUDE_WRITE_FLASH = -U flash:w:applet/$(TARGET).hex -AVRDUDE_FLAGS = -V -F -C $(INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf \ +AVRDUDE_FLAGS = -V -F -C $(INSTALL_DIR)/hardware/tools/avrdude.conf \ -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \ -b $(UPLOAD_RATE)
<
本業以外のどうでもいい今年の総括
|
秋葉でのみ
>