23
What is Arduino ? Arduino 機器人研習 講師: 賴偉民

Chapter 1 what is arduino

Embed Size (px)

Citation preview

Page 1: Chapter 1 what is arduino

What is Arduino ?

Arduino 機器人研習

講師: 賴偉民

Page 2: Chapter 1 what is arduino

Arduino 由來?

Page 3: Chapter 1 what is arduino

Arduino 特色

Page 4: Chapter 1 what is arduino

Arduino 特色

• 開放的軟硬體

• 與電子元件的溝通簡單

• 具互動式的軟體介面

Page 5: Chapter 1 what is arduino

Arduino 硬體

Page 6: Chapter 1 what is arduino

Arduino 硬體

Page 7: Chapter 1 what is arduino

Arduino 硬體

• ATMEGA單晶片

– 相當於電腦的CPU

– 管理板子的訊號溝通

– 類比數位訊號的轉換

Page 8: Chapter 1 what is arduino

Arduino 硬體

• FT232晶片

– 負責Arduino與電腦的通訊

– 燒錄程式與傳遞資料

• USB與RS-232轉換晶片

Page 9: Chapter 1 what is arduino

Arduino 硬體

USB接頭

電源輸入7-12V

電源輸出 類比輸入

數位輸入/輸出

Page 10: Chapter 1 what is arduino

Arduino 硬體微控制器 ATmega2560

工作電壓 5V

輸入電壓(建議) 7-12V

輸入電壓(限制) 6-20V

數位I/O Pins 54(有15個提供PWM訊號輸出)

類比Input Pins 16

I/O pin 直流電流 40mA

3.3V pin 直流電流 50mA

Flash 記憶體 256KB(其中8KB給bootloader用)

SRAM 8KB

EEPROM 4KB

時脈 16MHz

Page 11: Chapter 1 what is arduino

Arduino 軟體

Page 12: Chapter 1 what is arduino

Arduino 軟體

• 環境建置

– 至Arduino官網http://arduino.cc 可下載Arduino 1.0.1版軟體,解壓縮後無需進行安裝

按此下載

Page 13: Chapter 1 what is arduino

Arduino 軟體

• 安裝驅動程式(將Arduino接上電腦)

Page 14: Chapter 1 what is arduino

Arduino 軟體

Page 15: Chapter 1 what is arduino

Arduino 軟體

Page 16: Chapter 1 what is arduino

Arduino 軟體

• 到裝置管理員(我的電腦右鍵選擇管理)確認驅動程式已安裝完成

Page 17: Chapter 1 what is arduino

Arduino 軟體

• 驅動程式安裝完成後,重新拔插一次USB線,並確認arduino上的指示燈亮起

Page 18: Chapter 1 what is arduino

Arduino 軟體

• 程式開發環境介紹 New(新增檔案)

開啟一個空白頁面撰寫程式碼

Open(開啟舊檔案)

開啟副檔名為pde的專案檔

Save(儲存檔案)

儲存目前的專案

Verify/Compile(編譯目前專案)

驗證程式是否撰寫正確

Upload to I/O Board(載入開發板)

將已編譯的程式載入連接的硬體上

Serial Monitor(串列埠監看)

可查看輸入/輸出的資料

Page 19: Chapter 1 what is arduino

Arduino 軟體

• 點Tools>Board>

選取使用的控制板

Page 20: Chapter 1 what is arduino

Arduino 軟體

• 點 Tools > Serial Port

選擇正確的COM Port

Page 21: Chapter 1 what is arduino

Arduino 軟體

• 官方提供的範例程式

點File>Examples

Page 22: Chapter 1 what is arduino

Arduino 軟體

(1)這個函式只在程式啟動後執行一次(2)一般用在初始化參數及相關功能

(1)這個函式是負責程式中需重複執行的部份(2)程式直到電源關閉或按下重置時才會停止

Page 23: Chapter 1 what is arduino

動手做做看