2. 발표 내용
Raspberry Pi 2 Windows 10 IoT Core Visual Studio 2015
http://www.windowsondevices.com
3. 목차
Raspberry Pi 2 와 Windows 10 IoT Core 알아보기
Raspberry Pi 2 소개
Windows 10 IoT Core 소개
Windows 10 IoT Core 및 Visual Studio 2015 설치
Visual Studio 2015로 프로그래밍 하기
Demo, QnA
4. Raspberry Pi 2 소개
Raspberry Pi 2 Mobel B(Raspberry Pi 2) 특징
CPU : BCM2836, 900MHz Cortex A7 Quad Core
RAM : 1GB
4 USB Host Port
Full HDMI port
Ethernet
3.5mm audio jack with composite video
Camera interface
Display interface
Micro SD card slot
GPIO 40 Pins
Videocore IV GPU
5. Raspberry Pi 2 소개
Raspberry Pi 2 Mobel B(Raspberry Pi 2) 특징
Windows 10 IoT Core
NOOBS
RASPBIAN
UBUNTU MATE
OPENELEC
참고사이트
https://www.raspberrypi.org/products/raspberry-pi-2-model-b/
https://www.raspberrypi.org/downloads/
6. Windows 10 IoT Core 소개
Windows 10 IoT Core 특징
Low cost, small footprint devices 용 Windows 10 OS
ARM, x86, x64 지원
• x86 CPU : 400MHz 이상
• x86 instruction set 호환, PAE, NX, SSE2 지원
• ARM : 일부 SoC 만 지원
• RAM : Display 미지원 – 256MB 이상
Display 지원 – 512MB 이상
Universal Windows App 지원
참고사이트
http://www.windowsondevices.com
https://msdn.microsoft.com/en-
us/library/windows/hardware/dn915086(v=vs.85).aspx
7. Windows 10 IoT Core 소개
Windows 10 IoT Core 특징
지원 보드
• Raspberry Pi 2, MinnowBoard Max, dragonboard410c
개발 툴, 개발 언어
• Visual Studio 2015
• C/C++, C#, Python, etc.
8. Windows 10 IoT Core 및 Visual Studio 2015 설치
Windows 10 IoT Core 설치
준비 사항
• Windows 10이 설치된 PC
• Raspberry Pi 2
• 8GB 이상의 MicroSD Card
• MicroSD Card Reader
• Micro USB 케이블
• HDMI 지원 모니터 또는 TV
• LAN 케이블
Windows 10 IoT Core 이미지 받기
• Raspberry Pi 2 용 Windows 10 IoT Core 이미지 받기
http://ms-iot.github.io/content/en-US/Downloads.htm
• 다운 받은 ISO 파일 안의 msi 파일을 실행하여 설치
• Windows IoT Core Watcher 와 Windows IoT Core Image Helper 가 설치 됨
9. Windows 10 IoT Core 및 Visual Studio 2015 설치
Windows 10 IoT Core 설치
MicroSD Card에 OS 설치
• Windows IoT Core Image Helper를 실행
• MicroSD Card 드라이버와
OS 이미지 파일(.ffu)을 선택 후 Flash 버튼 클릭
Windows 10 IoT Core 부팅 하기
• MicroSD Card를 Raspberry Pi 2에 장착
• 전원을 넣으면 부팅 시작
• HDMI 모니터 연결
• PC와 LAN 연결
참고 사이트
http://ms-iot.github.io/content/en-US/win10/SetupRPI.htm
http://cafe.naver.com/kindplayer/3776
10. Windows 10 IoT Core 및 Visual Studio 2015 설치
Windows 10 IoT Core 부팅 완료
Windows 10 IoT Core 부팅 완료 화면
• 장치 정보가 표시 되며, 언어 및 네트웍 설정이 가능, 종료 버튼 사용
11. Windows 10 IoT Core 및 Visual Studio 2015 설치
Windows 10 IoT Core 부팅 완료
Windows IoT Core Watcher
• Raspberry Pi 2 보드 정보 표시 됨
• Web Browser Here 메뉴를 선택해서 장치 정보 확인 및 설정 가능
기본 ID : Administrator, Pass : p@ssw0rd
12. Windows 10 IoT Core 및 Visual Studio 2015 설치
Windows 10 IoT Core 부팅 완료
Web Browser
• 시스템 정보를 확인 및 설정 가능, 종료 버튼 사용
• 접속 주소 : http://Raspberry Pi 2 IP:8080
13. Windows 10 IoT Core 및 Visual Studio 2015 설치
Windows 10 IoT Core 부팅 완료
Windows Powershell 이용
• Raspberry Pi 2 보드 정보 확인 및 설정 가능
보드 IP 주소 이용
기본 ID : Administrator, Pass : p@ssw0rd
SSH Client 이용
• Raspberry Pi 2 보드 정보 확인 및 설정 가능
보드 IP 주소 이용, 22번 포트
기본 ID : Administrator, Pass : p@ssw0rd
참고사이트
http://ms-iot.github.io/content/en-US/win10/samples/SSH.htm
http://ms-iot.github.io/content/en-US/win10/samples/PowerShell.htm
14. Windows 10 IoT Core 및 Visual Studio 2015 설치
Visual Studio 2015 설치 및 기타 사항
준비 사항
• Windows 10이 설치된 PC
• Visual Studio 2015
Visual Studio Commnunity 버전 이용 가능
https://www.visualstudio.com/ 에서 다운로드 가능
Visual Studio 2015 설치
• 다운 받은 설치 파일 실행 후, 화면 지시대로 설치
• Universal Windows App Development Tools -> Tools and Windows SDK 를
반드시 설치
• 전체 설치 권장
개발자모드 활성화
• 설정 – 업데이트 및 복구 – 개발자용 - 개발자 모드 선택
15. Windows 10 IoT Core 및 Visual Studio 2015 설치
Visual Studio 2015 설치 및 기타 사항
Windows IoT Core Project Templates 설치
• https://visualstudiogallery.msdn.microsoft.com/ 에서 검색해서 다운로드
또는 Visual Studio 2015 Tools-Extensions and Updates 클릭 후, Online 탭에서
검색 후 설치
참고사이트
http://ms-iot.github.io/content/en-US/win10/SetupPCRPI.htm
16. Windows 10 IoT Core 및 Visual Studio 2015 설치
Visual Studio 2015 설치 확인
Windows IoT Core Project Templates 설치 확인
• File – New – Project… 메뉴 선택
17. Visual Studio 2015로 프로그래밍 하기
프로그래밍 하기 전 준비 사항
준비물
• Windows 10 설치된 PC
• Visual Studio 2015
• Raspberry Pi 2 보드 : Windows 10 IoT Core
PC와 Raspberry Pi2 보드 연결
• LAN 또는 WiFi로 연결 되어야 함
• PC와 직접 또는 공유기를 통한 연결
• 지원되는 WiFi : Raspberry Pi WiFi Adapter
http://swag.raspberrypi.org/collections/frontpage/products/official-raspberry-
pi-wifi-dongle
18. Visual Studio 2015로 프로그래밍 하기
프로그래밍 하기 전 준비 사항
Raspberry Pi 2 보드에 LED 연결
• GPIO 5번 핀에 LED - 극을 연결
• 3.3V 전원에 220 Ω 저항 연결
• 저항과 LED + 극 연결
GPIO 5번 HIGH -> LED Off
GPIO 5번 LOW -> LED On
참고사이트
http://ms-iot.github.io/content/en-US/win10/samples/Blinky.htm
19. Visual Studio 2015로 프로그래밍 하기
프로젝트 생성
LED On/Off 예제 프로젝트 생성
• Visual Studio 2015의 File – New – Project… 메뉴 선택
• Templates – Visual C# - Universal 선택
• Blank App(Universal Windows) 선택
• Project Name, Location 입력
20. Visual Studio 2015로 프로그래밍 하기
소스 코드 수정
MainPage.xaml 파일 수정
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
① <Ellipse x:Name="LED" Fill="LightGray" Stroke="White" Width="100"
Height="100" Margin="10"/>
② <TextBlock x:Name="DelayText" Text="500ms" Margin="10"
TextAlignment="Center" FontSize="26.667" />
③ <TextBlock x:Name="GpioStatus" Text="Waiting to initialize GPIO..."
Margin="10,50,10,10" TextAlignment="Center"
FontSize="26.667" />
</StackPanel>
</Grid>
21. Visual Studio 2015로 프로그래밍 하기
소스 코드 수정
MainPage.xaml.cs 파일 수정 : 변수 선언
// MainPage 내 변수
private const int LED_PIN = 5; ①
private GpioPin pin; ②
private GpioPinValue pinValue; ③
private DispatcherTimer timer; ④
private SolidColorBrush redBrush = new SolidColorBrush(Windows.UI.Colors.Red);
private SolidColorBrush grayBrush = new
SolidColorBrush(Windows.UI.Colors.LightGray);
22. Visual Studio 2015로 프로그래밍 하기
소스 코드 수정
MainPage.xaml.cs 파일 수정 : namespace 추가
MainPage.xaml.cs 파일 수정 : MainPage 수정
using Windows.Devices.Gpio;
public MainPage(){ // 타이머 생성, 시작
// 생략
timer = new DispatcherTimer(); ①
timer.Interval = TimeSpan.FromMilliseconds(500);
timer.Tick += Timer_Tick; ②
InitGPIO(); // GPIO 초기화
if (pin != null){ timer.Start(); } ③
}
23. Visual Studio 2015로 프로그래밍 하기
소스 코드 수정
MainPage.xaml.cs 파일 수정 : InitGPIO 함수 추가
private void InitGPIO(){
var gpio = GpioController.GetDefault(); // GPIO ①
if(gpio == null){
// 에러 처리 중략
}
pin = gpio.OpenPin(LED_PIN); ②
pinValue = GpioPinValue.High;
pin.Write(pinValue); ③
pin.SetDriveMode(GpioPinDriveMode.Output); // 출력 모드 ④
GpioStatus.Text = "GPIO pin initialized correctly.";
}
24. Visual Studio 2015로 프로그래밍 하기
소스 코드 수정
MainPage.xaml.cs 파일 수정 : Timer_Tick 함수 호출
private void Timer_Tick(object sender, object e){ ①
if (pinValue == GpioPinValue.High){
pinValue = GpioPinValue.Low;
pin.Write(pinValue);
LED.Fill = redBrush; ②
}
else{
pinValue = GpioPinValue.High;
pin.Write(pinValue);
LED.Fill = grayBrush;
}
}
25. Visual Studio 2015로 프로그래밍 하기
References 추가
Windows IoT Extensions for the UWP references 추가
• Add Reference… 메뉴 선택
• Universal Windows - Extensions에서 Windows IoT Extensions for the UWP
26. Visual Studio 2015로 프로그래밍 하기
Build 및 배포
Build
• Build 메뉴 이용
Remote Machine 설정
• ARM CPU 선택, Remote Machine 선택
• Remote Connections 설정 창에
Raspberry Pi 2 Name 또는 IP 를 입력
27. Visual Studio 2015로 프로그래밍 하기
Build 및 배포
배포
• Debug 메뉴 이용
• 디버깅 가능
배포 시, Output 화면
28. Demo
Demo
LED On/Off
TTS & Recognition 데모
• Windows Universal Samples 중에 SpeechRecognitionAndSynthesis 예제
• UAC 지원 마이크 사용
• 3.5mm 오디오 잭 사용
• https://github.com/Microsoft/Windows-universal-samples
USB웹캠 사용
• UVC 지원 웹캠 사용
• https://ms-iot.github.io/content/en-US/win10/samples/WebCamSample.htm
29. Q&A
Q&A
Windows 10 IoT Core
Raspberry Pi 2
Visual Studio 2015
Question?
개발자 Round Table
주제 : Windows 10 IoT Core
일시 : 2015년 11월 30일(월) 오후 7시
Raspberry Pi 2 Windows 10 IoT Core Visual Studio 2015
30. 참조
참조
Windows 10 IoT Core
http://www.windowsondevices.com
MS IoT Github
https://github.com/ms-iot
Universal Windows App Samples
https://github.com/Microsoft/Windows-universal-samples
착한세상
http://cafe.naver.com/kindplayer