41
1 Getting started with Amarino Speaker: Cooper Maa Date: 2012/07/18 http://coopermaa2nd.blogspot.com Logo drawn by honki

Getting started with amarino

  • Upload
    -

  • View
    28.473

  • Download
    4

Embed Size (px)

DESCRIPTION

An introduction to AmarinoAndroid meets Arduino

Citation preview

Page 1: Getting started with amarino

1

Getting started with Amarino

Speaker: Cooper MaaDate: 2012/07/18

http://coopermaa2nd.blogspot.com

Logo drawn by honki

Page 2: Getting started with amarino

2

Speaker

Cooper Maa PIC/AVR Firmware Programmer

Email: [email protected] Blog: http://coopermaa2nd.blogspot.com

Page 3: Getting started with amarino

3

What is Amarino?

Page 4: Getting started with amarino

4

Amarino is an Open Source Toolkit to let Android talk with Arduino over bluetooth

Page 5: Getting started with amarino

5

Objective: Blinking the Arduino’s LED

On board led

Page 6: Getting started with amarino

6

What do you need?

Page 7: Getting started with amarino

7

The Hardware

Android Arduino Bluetooth module

Page 8: Getting started with amarino

8

連接電腦與 Arduino

Page 9: Getting started with amarino

9

安裝 Arduino IDE

從官方網站下載 : http://arduino.cc/en/Main/Software

下載後解壓縮即可 執行 arduino.exe

Page 10: Getting started with amarino

10

下載 MeetAndroid : http://amarino.googlecode.com/files/MeetAndroid_4.zip

下載後,解至 Arduino IDE 安裝目錄的 libraries 資料夾下

例如 : C:\arduino-1.0.1\libraries

Sketch > Import Library 會看到 MeetAndroid

安裝 MeetAndroid Library

Page 11: Getting started with amarino

11

Upload Test Program 點選 File > Examples > MeetAndroid > Test

Page 12: Getting started with amarino

12

連接 Arduino 與藍芽模組

先把藍芽模組 baud rate 設定為 57600 bps 連接辦法 :

RXD 接至 TX of Arduino TXD 接至 RX of Arduino VCC to 5V of Arduino GND to GND of Arduino

Page 13: Getting started with amarino

13

Install Amarino App for Android

http://amarino.googlecode.com/files/Amarino_2_v0_55.apk

1. Install Amarino app

2. Install Amarino Plug-in Bundlehttp://amarino.googlecode.com/files/AmarinoPluginBundle.apk

Page 14: Getting started with amarino

14

Add Device

點【 Add BT Device 】搜尋藍芽設備

Page 15: Getting started with amarino

15

Add Test Event

Page 16: Getting started with amarino

16

Add Test Event - Continue

完成後,按下手機 Back 鍵

Page 17: Getting started with amarino

17

Connect

Page 18: Getting started with amarino

18

Arduino is connected

The led indicator will turn to green

Page 19: Getting started with amarino

19

On board LED will start to blink

The LED will blink when data is received from Android

Page 20: Getting started with amarino

20

總結需要的硬體

Android device x 1Arduino board x 1Bluetooth module x 1

測試步驟 安裝 Arduino IDE 與 MeetAndroid LibraryUpload Test Program to Arduino連接藍芽模組 安裝 Amarino App for Android 執行 Amarino 利用 Test Event 測試連線

Page 21: Getting started with amarino

21

MultiColorLamp Example

Picture comes from :http://www.circuit-blog.com/multi-color-lamp-using-amarino-android-and-arduino/

Page 22: Getting started with amarino

22

材料 一顆 RGB Led

紅、綠、藍 LED 各一顆

以及

三個 220 歐姆電阻

Page 23: Getting started with amarino

23

連接 LEDs 紅、綠、藍三顆 LED 分別接到 pin 9, 10, 11

Page 24: Getting started with amarino

24

Open MultiColorLamp example 點選 File > Examples > MeetAndroid > MultiColorLamp

Tutorial

Page 25: Getting started with amarino

25

Do some modifications 把 'o', 'p', 'q' 三個事件旗號改成 'r', 'g', 'b'

原本是 'o', 'p', 'q'配合 App 進行修改

Page 26: Getting started with amarino

26

上傳 MultiColorLamp 範例

注意!上傳程式時,記得不要接著藍芽模組!等上傳完畢後再接上!

Page 27: Getting started with amarino

27

Install MultiColorLamp App for Android

http://from-arduino-to-android-to-arduino.googlecode.com/files/MultiColorLamp-1.apk

Download and install MultiColorLamp App

Page 28: Getting started with amarino

28

抄錄藍芽 MAC Address

利用 Amarino 掃瞄藍芽並抄下 MAC

Page 29: Getting started with amarino

29

執行 MultiColorLamp App

輸入 MAC Address完畢後按【 Set Device ID 】

Page 30: Getting started with amarino

30

執行結果

因為沒有藍色 LED所以用黃色 LED 代替

Page 31: Getting started with amarino

31

SensorGraph Example

Page 32: Getting started with amarino

32

材料 一顆可變電阻

光敏電阻

Page 33: Getting started with amarino

33

連接可變電阻 把可變電阻接到 Analog pin 5

Page 34: Getting started with amarino

34

Open SensorGraph example 點選 File > Examples > MeetAndroid > SensorGraph

Tutorial

Page 35: Getting started with amarino

35

上傳 SensorGraph 範例

注意!上傳程式時,記得不要接著藍芽模組!等上傳完畢後再接上!

Page 36: Getting started with amarino

36

Install SensorGraph App for Android

http://from-arduino-to-android-to-arduino.googlecode.com/files/SensorGraph-1.apk

Download and install SensorGraph App

Page 37: Getting started with amarino

37

抄錄藍芽 MAC Address

利用 Amarino 掃瞄藍芽並抄下 MAC

Page 38: Getting started with amarino

38

執行 SensorGraph App

輸入 MAC Address完畢後按【 Set Device ID 】

Page 39: Getting started with amarino

39

執行結果

Page 40: Getting started with amarino

40

References

Android: http://developer.android.com Arduino: http://arduino.cc/ Amarino: http://www.amarino-toolkit.net/ http://coopermaa2nd.blogspot.tw/search/label/Android

Page 41: Getting started with amarino

41