playing with arduino open source h/w for mobile-centric services

164
Playing with Arduino Open-Source H/W for mobile-centric services

Upload: junhyuk-lee

Post on 15-Dec-2014

201 views

Category:

Engineering


2 download

DESCRIPTION

Playing with arduino open source h/w for mobile-centric services 2014년 9월 24일 통신학회 강의 개요 : 오픈소스 하드웨어를 기반으로 모바일과 클라우드 개발하는 방법 소개 1. 아두이노 소개 : 아두이노의 특징 및 IoT와의 상관관계 설명 2. 무선 통신 모듈 실습 : XBee, BT, WiFi 사용하기 3. 아두이노 YUN과 Temboo를 이용한 웹 API 활용 4. 아두이노 MEGA ADK를 이용한 안드로이드 기기와의 통신

TRANSCRIPT

Page 1: Playing with arduino open source h/w for mobile-centric services

Playing����������� ������������������  with����������� ������������������  Arduino����������� ������������������  ����������� ������������������  Open-Source����������� ������������������  H/W����������� ������������������  ����������� ������������������  

for����������� ������������������  mobile-centric����������� ������������������  services

Page 2: Playing with arduino open source h/w for mobile-centric services
Page 3: Playing with arduino open source h/w for mobile-centric services

C����������� ������������������  /����������� ������������������  C++����������� ������������������  할����������� ������������������  줄����������� ������������������  알아요!!

Page 4: Playing with arduino open source h/w for mobile-centric services

처음����������� ������������������  뵙겠습니다!!

Page 5: Playing with arduino open source h/w for mobile-centric services

저희도����������� ������������������  처음����������� ������������������  뵙겠습니다!!

Page 6: Playing with arduino open source h/w for mobile-centric services

강의����������� ������������������  순서

Page 7: Playing with arduino open source h/w for mobile-centric services
Page 8: Playing with arduino open source h/w for mobile-centric services
Page 9: Playing with arduino open source h/w for mobile-centric services

+ +

Page 10: Playing with arduino open source h/w for mobile-centric services

?

Page 11: Playing with arduino open source h/w for mobile-centric services

Ivrea

Page 12: Playing with arduino open source h/w for mobile-centric services

IDII(Interaction����������� ������������������  Design����������� ������������������  Institute����������� ������������������  Ivrea)����������� ������������������  2001����������� ������������������  ~����������� ������������������  2005

Page 13: Playing with arduino open source h/w for mobile-centric services

마시모����������� ������������������  반지����������� ������������������  (Massimo����������� ������������������  Banzi)

2002

Page 14: Playing with arduino open source h/w for mobile-centric services

피지컬����������� ������������������  컴퓨팅����������� ������������������  (Physical����������� ������������������  Computing)

Page 15: Playing with arduino open source h/w for mobile-centric services

베이직����������� ������������������  스탬프����������� ������������������  (BASIC����������� ������������������  Stamp)

Page 16: Playing with arduino open source h/w for mobile-centric services

1.학생들에게����������� ������������������  부담스런����������� ������������������  가격(당시����������� ������������������  100불)

2.윈도우에서만����������� ������������������  개발����������� ������������������  가능

3.저성능으로����������� ������������������  인한����������� ������������������  낮은����������� ������������������  사용성

Page 17: Playing with arduino open source h/w for mobile-centric services

케이시����������� ������������������  리아스����������� ������������������  (Casey����������� ������������������  Reas)

Page 18: Playing with arduino open source h/w for mobile-centric services

프로세싱����������� ������������������  (Processing)

Page 19: Playing with arduino open source h/w for mobile-centric services

프로세싱 아두이노

Page 20: Playing with arduino open source h/w for mobile-centric services
Page 21: Playing with arduino open source h/w for mobile-centric services

아두이노����������� ������������������  특징

Page 22: Playing with arduino open source h/w for mobile-centric services

1.����������� ������������������  쉽다!

Page 23: Playing with arduino open source h/w for mobile-centric services

digitalRead����������� ������������������  digitalWrite����������� ������������������  analogRead����������� ������������������  analogWrite

Page 24: Playing with arduino open source h/w for mobile-centric services

MP3 WiFi

Motor Joystick

Page 25: Playing with arduino open source h/w for mobile-centric services

2.����������� ������������������  오픈소스다!

Page 26: Playing with arduino open source h/w for mobile-centric services
Page 27: Playing with arduino open source h/w for mobile-centric services
Page 28: Playing with arduino open source h/w for mobile-centric services
Page 29: Playing with arduino open source h/w for mobile-centric services
Page 30: Playing with arduino open source h/w for mobile-centric services

https://github.com/vheun/ArduinoPlaysTimberman

Page 31: Playing with arduino open source h/w for mobile-centric services
Page 32: Playing with arduino open source h/w for mobile-centric services

3.����������� ������������������  싸다!

Page 33: Playing with arduino open source h/w for mobile-centric services

Page 34: Playing with arduino open source h/w for mobile-centric services

http://www.aliexpress.com/

Page 35: Playing with arduino open source h/w for mobile-centric services

아두이노를����������� ������������������  ����������� ������������������  배워봅시다!

Page 36: Playing with arduino open source h/w for mobile-centric services
Page 37: Playing with arduino open source h/w for mobile-centric services
Page 38: Playing with arduino open source h/w for mobile-centric services
Page 39: Playing with arduino open source h/w for mobile-centric services

입력

출력

디지털 아날로그

Page 40: Playing with arduino open source h/w for mobile-centric services

입력

Page 41: Playing with arduino open source h/w for mobile-centric services
Page 42: Playing with arduino open source h/w for mobile-centric services
Page 43: Playing with arduino open source h/w for mobile-centric services

출력

Page 44: Playing with arduino open source h/w for mobile-centric services
Page 45: Playing with arduino open source h/w for mobile-centric services
Page 46: Playing with arduino open source h/w for mobile-centric services

그����������� ������������������  외����������� ������������������  전자부품

Page 47: Playing with arduino open source h/w for mobile-centric services

저항

Page 48: Playing with arduino open source h/w for mobile-centric services

열����������� ������������������  에너지

Page 49: Playing with arduino open source h/w for mobile-centric services

축전지

Page 50: Playing with arduino open source h/w for mobile-centric services
Page 51: Playing with arduino open source h/w for mobile-centric services

다이오드

Page 52: Playing with arduino open source h/w for mobile-centric services
Page 53: Playing with arduino open source h/w for mobile-centric services

브레드����������� ������������������  보드

Page 54: Playing with arduino open source h/w for mobile-centric services

디지털����������� ������������������  &����������� ������������������  아날로그

Page 55: Playing with arduino open source h/w for mobile-centric services

ON OFF

Page 56: Playing with arduino open source h/w for mobile-centric services

디지털

Page 57: Playing with arduino open source h/w for mobile-centric services
Page 58: Playing with arduino open source h/w for mobile-centric services

pinMode(13,OUTPUT)INPUT����������� ������������������  OUTPUT

Page 59: Playing with arduino open source h/w for mobile-centric services

int����������� ������������������  a����������� ������������������  =����������� ������������������  digitalRead(13);

Page 60: Playing with arduino open source h/w for mobile-centric services

HIGH LOW

Page 61: Playing with arduino open source h/w for mobile-centric services

PULL-UP����������� ������������������  PULL-DOWN

Page 62: Playing with arduino open source h/w for mobile-centric services

내가����������� ������������������  불을����������� ������������������  켜면����������� ������������������  뛰고,����������� ������������������  

불이����������� ������������������  꺼지면����������� ������������������  멈춰!!

알겠음!!

Page 63: Playing with arduino open source h/w for mobile-centric services
Page 64: Playing with arduino open source h/w for mobile-centric services
Page 65: Playing with arduino open source h/w for mobile-centric services
Page 66: Playing with arduino open source h/w for mobile-centric services

digitalWrite(13,����������� ������������������  HIGH);LOW����������� ������������������  HIGH

Page 67: Playing with arduino open source h/w for mobile-centric services
Page 68: Playing with arduino open source h/w for mobile-centric services

아날로그

Page 69: Playing with arduino open source h/w for mobile-centric services
Page 70: Playing with arduino open source h/w for mobile-centric services

int����������� ������������������  a����������� ������������������  =����������� ������������������  analogRead(A0);

(0����������� ������������������  ~����������� ������������������  1,023)

Page 71: Playing with arduino open source h/w for mobile-centric services
Page 72: Playing with arduino open source h/w for mobile-centric services

PWM

Page 73: Playing with arduino open source h/w for mobile-centric services
Page 74: Playing with arduino open source h/w for mobile-centric services
Page 75: Playing with arduino open source h/w for mobile-centric services

HIGH

LOW

Page 76: Playing with arduino open source h/w for mobile-centric services

analogWrite(9,����������� ������������������  255)0����������� ������������������  ~����������� ������������������  255

Page 77: Playing with arduino open source h/w for mobile-centric services
Page 78: Playing with arduino open source h/w for mobile-centric services

void����������� ������������������  setup(){����������� ������������������  !

}����������� ������������������  !void����������� ������������������  loop(){����������� ������������������  !

}

한번����������� ������������������  실행

반복����������� ������������������  실행

Page 79: Playing with arduino open source h/w for mobile-centric services

main??

Page 80: Playing with arduino open source h/w for mobile-centric services

int����������� ������������������  main(void)����������� ������������������  {����������� ������������������  ����������� ������������������   init();����������� ������������������  !

����������� ������������������   initVariant();����������� ������������������  !

#if����������� ������������������  defined(USBCON)����������� ������������������  ����������� ������������������   USBDevice.attach();����������� ������������������  #endif����������� ������������������  ����������� ������������������   ����������� ������������������  ����������� ������������������   setup();����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������   for����������� ������������������  (;;)����������� ������������������  {����������� ������������������  ����������� ������������������   ����������� ������������������   loop();����������� ������������������  ����������� ������������������   ����������� ������������������   if����������� ������������������  (serialEventRun)����������� ������������������  serialEventRun();����������� ������������������  ����������� ������������������   }����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������   return����������� ������������������  0;����������� ������������������  }

Page 81: Playing with arduino open source h/w for mobile-centric services

void����������� ������������������  setup(){����������� ������������������  !

}����������� ������������������  !void����������� ������������������  loop(){����������� ������������������  !

}

초기화

동작����������� ������������������  관련

Page 82: Playing with arduino open source h/w for mobile-centric services
Page 83: Playing with arduino open source h/w for mobile-centric services

http://arduino.cc/en/Reference/Libraries

Page 84: Playing with arduino open source h/w for mobile-centric services

아두이노����������� ������������������  &����������� ������������������  IoT

Page 85: Playing with arduino open source h/w for mobile-centric services
Page 86: Playing with arduino open source h/w for mobile-centric services
Page 87: Playing with arduino open source h/w for mobile-centric services
Page 88: Playing with arduino open source h/w for mobile-centric services

?

Page 89: Playing with arduino open source h/w for mobile-centric services

https://www.kickstarter.com/

Page 90: Playing with arduino open source h/w for mobile-centric services

프로토타입����������� ������������������  개발����������� ������������������  시간����������� ������������������  단축

Page 91: Playing with arduino open source h/w for mobile-centric services
Page 92: Playing with arduino open source h/w for mobile-centric services
Page 93: Playing with arduino open source h/w for mobile-centric services
Page 94: Playing with arduino open source h/w for mobile-centric services

통신����������� ������������������  모듈

Page 95: Playing with arduino open source h/w for mobile-centric services

시리얼����������� ������������������  통신

Page 96: Playing with arduino open source h/w for mobile-centric services
Page 97: Playing with arduino open source h/w for mobile-centric services
Page 98: Playing with arduino open source h/w for mobile-centric services
Page 99: Playing with arduino open source h/w for mobile-centric services

블루투스

Page 100: Playing with arduino open source h/w for mobile-centric services
Page 101: Playing with arduino open source h/w for mobile-centric services

RXD

TXD

Page 102: Playing with arduino open source h/w for mobile-centric services
Page 103: Playing with arduino open source h/w for mobile-centric services
Page 104: Playing with arduino open source h/w for mobile-centric services
Page 105: Playing with arduino open source h/w for mobile-centric services

Android����������� ������������������  Sample����������� ������������������  Project

BluetoothChat

Page 106: Playing with arduino open source h/w for mobile-centric services

XBee

Page 107: Playing with arduino open source h/w for mobile-centric services

https://www.sparkfun.com/

시리즈,����������� ������������������  XBee����������� ������������������  모듈����������� ������������������  방향����������� ������������������  확인

Page 108: Playing with arduino open source h/w for mobile-centric services

스위치를����������� ������������������  DLINE으로����������� ������������������  설정

Page 109: Playing with arduino open source h/w for mobile-centric services

http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/xctu

Page 110: Playing with arduino open source h/w for mobile-centric services
Page 111: Playing with arduino open source h/w for mobile-centric services
Page 112: Playing with arduino open source h/w for mobile-centric services
Page 113: Playing with arduino open source h/w for mobile-centric services
Page 114: Playing with arduino open source h/w for mobile-centric services
Page 115: Playing with arduino open source h/w for mobile-centric services
Page 116: Playing with arduino open source h/w for mobile-centric services
Page 117: Playing with arduino open source h/w for mobile-centric services

WiFi

Page 118: Playing with arduino open source h/w for mobile-centric services
Page 119: Playing with arduino open source h/w for mobile-centric services

http://arduino.cc/en/Hacking/WiFiShieldFirmwareUpgrading����������� ������������������  http://flashgamer.com/arduino/comments/how-to-update-the-official-arduino-wifi-shield

Page 120: Playing with arduino open source h/w for mobile-centric services

J3����������� ������������������  커넥터.����������� ������������������  업그레이드시에만����������� ������������������  연결하고,����������� ������������������  평소에는����������� ������������������  빼고����������� ������������������  사용.

Page 121: Playing with arduino open source h/w for mobile-centric services

아두이노����������� ������������������  IDE����������� ������������������  1.0.6����������� ������������������  사용

http://arduino.cc/en/Main/Software

Page 122: Playing with arduino open source h/w for mobile-centric services

파일����������� ������������������  -����������� ������������������  예제����������� ������������������  -����������� ������������������  WiFi����������� ������������������  -����������� ������������������  WiFiWebClient

WiFi����������� ������������������  SSID와����������� ������������������  비밀번호����������� ������������������  입력

Page 123: Playing with arduino open source h/w for mobile-centric services
Page 124: Playing with arduino open source h/w for mobile-centric services
Page 125: Playing with arduino open source h/w for mobile-centric services

http://arduino.cc/en/Tutorial/YunSysupgrade

Page 126: Playing with arduino open source h/w for mobile-centric services
Page 127: Playing with arduino open source h/w for mobile-centric services

http://arduino.local/����������� ������������������  http://192.168.240.1

arduino

Page 128: Playing with arduino open source h/w for mobile-centric services
Page 129: Playing with arduino open source h/w for mobile-centric services

기본����������� ������������������  정보����������� ������������������  및����������� ������������������  타임����������� ������������������  존����������� ������������������  변경����������� ������������������  가능

Page 130: Playing with arduino open source h/w for mobile-centric services

WiFi����������� ������������������  관련����������� ������������������  설정

OPEN

Page 131: Playing with arduino open source h/w for mobile-centric services

http://arduino.local/

arduino

Page 132: Playing with arduino open source h/w for mobile-centric services

아두이노����������� ������������������  IDE����������� ������������������  1.5.7����������� ������������������  사용

Page 133: Playing with arduino open source h/w for mobile-centric services

파일����������� ������������������  -����������� ������������������  예제����������� ������������������  -����������� ������������������  Bridge����������� ������������������  -����������� ������������������  HttpClient

Page 134: Playing with arduino open source h/w for mobile-centric services

파일����������� ������������������  -����������� ������������������  예제����������� ������������������  -����������� ������������������  Bridge����������� ������������������  -����������� ������������������  Bridge

제거

Page 135: Playing with arduino open source h/w for mobile-centric services

http://arduino.cc/en/Tutorial/Bridge

Page 136: Playing with arduino open source h/w for mobile-centric services

https://www.temboo.com/

Page 137: Playing with arduino open source h/w for mobile-centric services

https://www.temboo.com/library/

Page 138: Playing with arduino open source h/w for mobile-centric services

Yahoo����������� ������������������  -����������� ������������������  Weather����������� ������������������  -����������� ������������������  GetWeatherByAddress

Page 139: Playing with arduino open source h/w for mobile-centric services

1.����������� ������������������  IoT����������� ������������������  Mode����������� ������������������  ON

2.����������� ������������������  Arduino����������� ������������������  Yun

3.����������� ������������������  seoul����������� ������������������  입력����������� ������������������  후����������� ������������������  엔터

4.����������� ������������������  결과

Page 140: Playing with arduino open source h/w for mobile-centric services

TembooAccount.h

Page 141: Playing with arduino open source h/w for mobile-centric services
Page 142: Playing with arduino open source h/w for mobile-centric services

TembooAccount.h

Page 143: Playing with arduino open source h/w for mobile-centric services
Page 144: Playing with arduino open source h/w for mobile-centric services
Page 145: Playing with arduino open source h/w for mobile-centric services

Device����������� ������������������  Coder����������� ������������������  -����������� ������������������  Arduino����������� ������������������  -����������� ������������������  Yun����������� ������������������  -����������� ������������������  Phone

Page 146: Playing with arduino open source h/w for mobile-centric services

예)����������� ������������������  02-123-4567

Page 147: Playing with arduino open source h/w for mobile-centric services

https://kr.nexmo.com/

Page 148: Playing with arduino open source h/w for mobile-centric services
Page 149: Playing with arduino open source h/w for mobile-centric services
Page 150: Playing with arduino open source h/w for mobile-centric services
Page 151: Playing with arduino open source h/w for mobile-centric services
Page 152: Playing with arduino open source h/w for mobile-centric services

Accessory����������� ������������������  Development����������� ������������������  Kit

Page 153: Playing with arduino open source h/w for mobile-centric services

https://github.com/felis/USB_Host_Shield_2.0

Page 154: Playing with arduino open source h/w for mobile-centric services

폴더명을����������� ������������������  USB_Host_Shield_20����������� ������������������  

으로����������� ������������������  변경

Page 155: Playing with arduino open source h/w for mobile-centric services

문서����������� ������������������  폴더����������� ������������������  -����������� ������������������  Arduino����������� ������������������  -����������� ������������������  libraries

Page 156: Playing with arduino open source h/w for mobile-centric services
Page 157: Playing with arduino open source h/w for mobile-centric services

42번째����������� ������������������  줄����������� ������������������  #define����������� ������������������  USE_UHS_MEGA_ADK����������� ������������������  0

#define����������� ������������������  USE_UHS_MEGA_ADK����������� ������������������  1

Page 158: Playing with arduino open source h/w for mobile-centric services
Page 159: Playing with arduino open source h/w for mobile-centric services

파일����������� ������������������  -����������� ������������������  예제����������� ������������������  -����������� ������������������  USB_Host_Shield_20����������� ������������������  -����������� ������������������  adk����������� ������������������  -����������� ������������������  ArduinoBlinkLED����������� ������������������  

Page 160: Playing with arduino open source h/w for mobile-centric services
Page 161: Playing with arduino open source h/w for mobile-centric services
Page 162: Playing with arduino open source h/w for mobile-centric services

https://github.com/Lauszus/ArduinoBlinkLED

Page 163: Playing with arduino open source h/w for mobile-centric services

http://felis.github.io/USB_Host_Shield_2.0/

Page 164: Playing with arduino open source h/w for mobile-centric services

들어주셔서����������� ������������������  감사합니다^-^

[email protected]