arduino 邁向雲端 - playrobot · arduino yun 就是 arduino的編譯語法 23 連結arduino...

50
Arduino 邁向雲端 IOT 實務特色課程 介紹 飆機器人_普特企業有限公司

Upload: truongkhuong

Post on 15-Feb-2019

249 views

Category:

Documents


0 download

TRANSCRIPT

Arduino IOT

_

2

: !

_

3

4

Arduino_

ABB Car Arduino_ C / BASIC LED _ LED C _ ( if elese) _ _ /ABB Car / / ABB-Car /

C

[ ] / / / /

PCP Parallax Certified Professional

Parallax

Arduino PCP

PCP

[ ]

...

[ ] ...

[ ]

[ ] .....

PCP

Arduino

Arduino

104

Arduino_

Arduino

_ 1041217()09:00~16:00 6 30 1011214 6

Arduino _ ABB Car

Arduino Arduino Smart Bot

Arduino()_ PID

Arduino()_ WiFi

()

PCP

Arduino BB Car

Flash Unity

WiFiWeb Zigbee/RFID

Wifi/ / / Web

//

Android / App /

PID

Arduino

18

() -

-

PID

()

ZigbeeGPSWi-FiWeb

/4.0 /

LabView / / App

Arduino 3Pi...

DEMO Room

Arduino

1. YBB Car _Arduino YUN

2. YBB Car IOT

3.

4. _YBB Car

5. _YBB Car

6. (...)

7. YBB Car IOT

10

11

1. YBB Car _Arduino YUN

2. YBB Car IOT

3.

4. _YBB Car

5. _YBB Car

6. (...)

7. YBB Car IOT

Arduino

IOT

BB Car Arduino Arduino Step by step API Arduino + Linux OS / : + IOT

YBB Car

: !

IOT = +

+ IOT

/ MIPS @400 MHz / 64 MB DDR2 / 16 M Flash microSDflash (64MB) Router / WIFI http(URL) API

TembooGoogle Twitter DropboxEmailfb...... HTML/AJAX _ APP /

Google Doc / Map

4.0 BIG Data

APP HTML

Email Dropbox Facebook

14

YBB Car CH1 Arduino Yn YBB CarTemboo 3 CH2 Arduino Yn LED 17 CH3 WiFi YBB Car 23 CH4 !-Temboo 39 CH5 E-mail 47 CH6 Google Doc 59 CH7 Facebook 79 CH8 GPSGoogle DocGoogle Map 89 CH9 YBB Car 99

9-1 DropboxOAuth 99 9-2 103 9-3 Dropbox 108 9-4 112

CH10 HTMLApp Inventor 2YBB Car 115 10-1 Yn 115 10-2 AJAXYBB Car 116 10-3 App InventorArduino Yn 136

15

? IOT4.0 YBB Car !

16

1. YBB Car _Arduino YUN

2. YBB Car IOT

3.

4. _YBB Car

5. _YBB Car

6. (...)

7. YBB Car IOT

Arduino

Leonado + AP = Yun = 32U4 + Atheros AR9331

IR-505

ATmega328

32U4 Arduino YUN Mini

or

YBB Car_ Arduino Yun

Arduino YnArduino LeonadoAtmel 32U4 Atheros AR9331

micro SD

Leonado + AP = Yun = 32U4 + Atheros AR9331

Arduino Leonado WiFi A-type USBSD

LinuxLininoOpenWRT-Yun

Digital I/O &I2C

Atheros AR9331 & WiFi

micro USB

A-type USB

Power

Analog I/O

1. 5V 2. Linux

YBB Car_ Arduino Yun

YBB Car

YBB CarArduino YnParallaxBoe-BotArduino Yn500mAPlayDuino V5 ShieldPlayDuino V5 Shield

19

20

IP/

YBB car

_

()

192.168.240.1

YBB Car Router

IOT

21

YBB Car Arduino YUN

= +

Yun

Step1. YBB Car YUNMAC YBB Car (WLANrest)

Arduino Yun-XXXXXXXXXXXX

2-2 : Arduino YUN Arduino

23

Arduino YnLED Arduino IDEFileExamples01.BasicsBlink

PWM Arduino IDEFileExamples03.AnalogFading

Fading.ino ~

Blink.ino ~

LED913

1. YBB Car _Arduino YUN

2. YBB Car IOT

3.

4. _YBB Car

5. _YBB Car

6. (...)

7. YBB Car IOT

24

25

YunATmega 32u4AR9331Bridge LibraryArduinoLinuxArduinoArduino Class

Arduino VS

httpURLArduino YBB Car LED

http

http://192.168.240.1/arduino/digital/13/0 PIN13-LOW http://192.168.240.1/arduino/digital/13/1 PIN13-HIGH http://192.168.240.1/arduino/status/status

26

YUN wifi

YBB Car(ABB Car )

27

YBB Car

28

Arduino (ABB Car) 18 ABB CarLEDABB CarAndroidABB Car

Chapter 1 Arduino Chapter 2 LED Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 _ Chapter 8 Chapter 9 Chapter 10 _ Chapter 11 _ Chapter 12 (1)_ Chapter 13 (2)_ Chapter 14 C(PlayRobot_ArduBlock) Chapter 15 _ Chapter 16 _ Chapter 17 _App Inventor 2 Chapter 18 _App Inventor 2 ABB Car ASCII

YBB Car (ABB Car )

Rotational Velocity vs. Pulse Width for Servo

-60

-40

-20

0

20

40

60

1.300 1.350 1.400 1.450 1.500 1.550 1.600 1.650 1.700

Pulse Width, ms

Ro

tatio

nal V

elo

cit

y, R

PM

Right Servo

()

ABB Car

//ABB Car #include // Servo Library Servo servoRight; // Servo Servo servoLeft; void setup(){ servoRight.attach(12); // pin 12 servoLeft.attach(13); // pin 13 } void loop(){ forward(); // trunLeft(); // trunRight(); // backward(); // }

int forward(){ // servoRight.writeMicroseconds(1300); servoLeft.writeMicroseconds(1700); delay(1000); } int trunLeft(){ // servoRight.writeMicroseconds(1700); servoLeft.writeMicroseconds(1700); delay(300); }

int trunRight(){ // servoRight.writeMicroseconds(1300); servoLeft.writeMicroseconds(1300); delay(300); } int backward(){ // servoRight.writeMicroseconds(1700); servoLeft.writeMicroseconds(1300); delay(1000); }

1. BridgeRESTstyle.ino 2.

http:// 192.168.240.1/arduino/robot/1 forward http:// 192.168.240.1/arduino/robot/2 backward http:// 192.168.240.1/arduino/robot/3 trunRight http:// 192.168.240.1/arduino/robot/4 trunLeft

WiFi YBB

1. YBB Car _Arduino YUN

2. YBB Car IOT

3.

4. _YBB Car

5. _YBB Car

6. (...)

7. YBB Car IOT

33

YBB Car IOT VS

All Sensors

35

Google Doc

APP

HTML

Email Dropbox Facebook

1. YBB Car _Arduino YUN

2. YBB Car IOT

3.

4. _YBB Car

5. _YBB Car

6. (...)

7. YBB Car IOT

36

37

WiFi

/ AJAX / App

YBB Car _ / App

_ _ YBB

38

Step1: ControlYBBCarViaAJAXRESTstyle.ino,

Step2:

192.168.240.1/sd/AJAX

1. YBB Car _Arduino YUN

2. YBB Car IOT

3.

4. _YBB Car

5. _YBB Car

6. (...)

7. YBB Car IOT

39

PCP

Arduino BB Car

Flash Unity

WiFiWeb Zigbee/RFID

Wifi/ / / Web

//

Android / App /

PID

Arduino

18

() -

-

PID

()

ZigbeeGPSWi-FiWeb

/4.0 /

LabView / / App

Arduino 3Pi...

DEMO Room

42

4.0_[]

4.0Arduino"LabView @ _LED @ _ @ _LCD @ _USB/SD @ @ _LED @ _ (PWM/Stamplot) @ _(I2C) @ Arduino_(1)_ @ (2)_ Zigbee @ _(3) _RFID @ _WiFi @ _ @ __(Serial/Ecxel) @ @ ()App @ ()LabViewArduino () @ _LabView (I2C)_3D @ _LabViewCamera + PWM

1. YBB Car _Arduino YUN

2. YBB Car IOT

3.

4. _YBB Car

5. _YBB Car

6. (...)

7. YBB Car IOT

43

() _

45

1. Arduino YUN

2. YBB Car

3. (Temboo)

4. E-mail

5. Google Doc

6.

7. 4.0_ ()

8. 46

Chapter 1 LinkIt ONE Chapter 2 LED Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 LBB Car Chapter 12 LBB Chapter 13 _App Chapter 14 _App LBB Car Chapter 15 LBB Car Chapter 16 _MCS Chapter 17 _GPS Chapter 18 MCS_ Chapter 19 MCS_ Chapter 20 _NFC

[ Arduino IOT _Linkit ONE LBB Car ]

48

1.

2. 3.

4.

49

* _lilypad (.....)

* Myo

* _

* NFC_

* RFID

* RFID

* Zigbee_

* _

(Cloud & Artificial

Intelligence Layer)

YBB Car

* WiFi_Arduino Yn YBB CarTemboo

* !-Temboo

* E-mail

* Facebook

* Excel

* Google Doc

* GPSGoogle DocGoogle Map

* Yn

Dropbox

(IOT &

Human Decision

Layer)

_

ArduinoAPP

HTMLApp Inventor 2

*

*

(Sensing &

Responding Layer)

(Communications

Layer)

: / / / / / / .....

_ ABB+LilyPad

1 x LilyPad Button 1 x LilyPad Slide Switch 5 x LilyPad Bright White LED 1 x LilyPad RGB Tri-Color LED 1 x LilyPad Light Sensor 1 x LilyPad Temp Sensor 1 x LilyPad Buzzer 1 x LilyPad Vibe Board LilyPad ProtoSnap

http://www.sparkfun.com/products/8776http://www.sparkfun.com/products/9350http://www.sparkfun.com/products/10081http://www.sparkfun.com/products/8467http://www.sparkfun.com/products/8467http://www.sparkfun.com/products/8467http://www.sparkfun.com/products/8464http://www.sparkfun.com/products/8777http://www.sparkfun.com/products/8463http://www.sparkfun.com/products/8468http://www.playrobot.com/cart/shop.php?id=1049&factory=&header=&sub=&Fno=&date_buy=http://www.playrobot.com/cart/shop.php?id=1049&factory=&header=&sub=&Fno=&date_buy=