VisualStudio를 실행하고 Empty Project를 생성하면 아래와 같이 vMicro라고 새로운 메뉴가 생긴다. Arduino 관련 설정, 프로젝트 관리, Library 설치, 빌드 및 실행은 이 메뉴에서 다 해결할 수 있다.
하드웨어 설정
아두이노 UNO를 이용할 경우 보드설정은 아래와 같다.
- 보드: Arduino/Genuino UNO
- 포트: USB Serial Port COM5(고정되지 않고 환경에 따라 달라질 수 있음)
- Uploader : Hardware Programmer : No
- Enable Programer
- Debug: Serial
4. 빌드 및 업로드
blink 예제를 오픈하고 다운로드 해본다.
vMicro -> visual Micro Exploer를 선택한다.
Examples -> IDE Examples -> Blink를 선택한다.
blink 예제가 프로젝트에 로딩되면 아래와 같이 blink.ino 파일을 불러온다.
빌드전 아래와 같이 Uploader에서 Verbose를 체크한다. 그러면 빌드 과정에서 발생하는 메시지들을 상세하게 확인할 수 있다.
F5를 눌러 실행하면 컴파일이 완료되고, 업로드가 실행된다.
보드에는 LED가 Blink되는 것을 확인할 수 있다.
빌드가 성공적으로 완료되면 Visual Studio 하단 출력 보기에서 Build 결과를 아래와 같이 확인할 수 있다.
An example debugger breakpoint has been created. To switch the demo breakpoint off, deselect Visual Micro>General>Tutorial Mode.
Compiling debug version of 'Blink' for 'Arduino/Genuino Uno' Program size: 2,924 bytes (used 9% of a 32,256 byte maximum) (1.91 secs) Minimum Memory Usage: 298 bytes (15% of a 2048 byte maximum)
Uploading 'Blink' to 'Arduino/Genuino Uno' using 'COM5' Uploader started for board Arduino/Genuino Uno Upload method will be: bootloader Uploading via Bootloader C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude "-CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM5" -b115200 -D "-Uflash:w:C:\Users\seung\AppData\Local\Temp\VMBuilds\Blink\uno\Debug/Blink.ino.hex:i" avrdude: Version 6.3-20190619 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" Using Port : COM5 Using Programmer : arduino Overriding Baud Rate : 115200 AVR Part : ATmega328P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Programmer Type : Arduino Description : Arduino Hardware Version: 3 Firmware Version: 4.4 Vtarget : 0.3 V Varef : 0.3 V Oscillator : 28.800 kHz SCK period : 3.3 us avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e950f (probably m328p) avrdude: safemode: lfuse reads as 0 avrdude: safemode: hfuse reads as 0 avrdude: safemode: efuse reads as 0 avrdude: reading input file "C:\Users\seung\AppData\Local\Temp\VMBuilds\Blink\uno\Debug/Blink.ino.hex" avrdude: writing flash (2924 bytes): Writing | ################################################## | 100% 0.47s avrdude: 2924 bytes of flash written avrdude: safemode: lfuse reads as 0 avrdude: safemode: hfuse reads as 0 avrdude: safemode: efuse reads as 0 avrdude: safemode: Fuses OK (E:00, H:00, L:00) The upload process has finished. avrdude done. Thank you.
댓글