• Increase font size
  • Default font size
  • Decrease font size
  • default color
  • cyan color
  • red color

Arduino.TW樂園

Member Area
用Xcode 3.2.x 開發 arduino
站長Blog文章單元 - 非官方Arduino IDE開發(Eclipse, Xcode)
作者是 ken   
週二, 25 五月 2010 15:11

0. 先連上Apple Developer Center [http://developer.apple.com/technologies/xcode.html] 下載XCode 3.2.2

1.安裝完畢後,先下載arduino project template[ download ] source:http://itp.nyu.edu/oldITPedia/Arduino_in_Xcode

2.然後需先安裝CrossPack AVR 可參考前篇文章:[mac上開發ATMEGA]

3.下載完畢之前的project template之後解壓縮資料放到/Developer/Library/Xcode/Project Templates/Other/

3.放置完畢後在Dock上啟動Xcode,跳出Welcome畫面時候點選Create a new Xcode Project

 

4. 點選左邊的Mac OS X 子項Other,中間會出現剛剛置入的Arduino on xcode

5. 輸入要置放project的位置名稱之後,在左邊的Gropu & Files中打開MakeFile做修改

6. 然後修改以下黃色區域

64 行 : ARDUINO = /Applications/arduino-0013/hardware/cores/arduino/

改成:/Applications/Arduino0017.app/Contents/Resources/Java/hardware/cores/arduino/ [這裡依照您的arduino資料夾]

65 行:AVRDUDE_DIR = /usr/local/AVRMacPack/bin/

改成:/usr/local/CrossPack-AVR-20100115/bin/ [這裡依照您的CrossPack AVR資料夾]

71行:$(ARDUINO)/wiring_pulse.c $(ARDUINO)/wiring_serial.c \

改成:$(ARDUINO)/wiring_pulse.c \

74行:MCU = atmega168

改成:MCU = atmega328p [這裡您可以改成您的device名稱]

77行:UPLOAD_RATE = 19200

改成:UPLOAD_RATE = 57600

接著改

102行:CSTANDARD = -std=gnu99

改成:#CSTANDARD = -std=gnu99

104行:CWARN = -Wall -Wstrict-prototypes

改成:#CWARN = -Wall -Wstrict-prototypes

115行:AVRDUDE_PROGRAMMER = stk500

改成:AVRDUDE_PROGRAMMER = stk500v1

最後在最後一行加上:AVRDUDE_FLAGS: -D

7.改好之後按上方工具列的 build->Clean All Targets

這裡您應該還是會有一個錯誤訊息:

core.a(Print.o):(.data+0x6): undefined reference to `__cxa_pure_virtual'
原因是尚未定義__cxa_pure_virtual這個function

接著在main.c的上方加入以下這一行

extern "C"  void __cxa_pure_virtual() {}

8. 改好之後就可以在Active Target 選擇 Upload 之後在重新按 Build -> Clean All Targets

9. 然後就會看到成功寫入的訊息列


 


blog comments powered by Disqus
最近更新在 週四, 03 六月 2010 12:19
 

幫助我們推廣