Loading [MathJax]/jax/output/CommonHTML/jax.js
본문 바로가기
  • 경제적 자유를 얻는 그날까지
엔지니어링/임베디드

[아두이노 기초교육] Visual Studio for Arduino 설치 및 개발 환경설정

by 베니스상인 2019. 10. 22.

 

1. Visual Studio 설치

- 무료버전

- 아래의 Installer를 받아서 Visual Studio를 설치하면 된다. 용도에 따라 팔요한 구성품을 같이 다운로드 받는다.

 

https://visualstudio.microsoft.com/ko/thank-you-downloading-visual-studio/?sku=community&rel=16

 

Visual Studio를 다운로드해 주셔서 감사합니다. - Visual Studio

다운로드가 곧 시작됩니다. 다운로드가 시작되지 않은 경우에는 여기를 클릭하여 다시 시도하세요 자습서, 샘플, 문서를 찾아 코딩을 시작하십시오. 자세히 보기 첫 번째 “Hello World!” 만들기 Visual Studio 2019를 사용하는 C++ 콘솔 앱. 시작

visualstudio.microsoft.com

 

2. Arduino plugin 설치

- 크롬 브라우저를 사용하여 아래 링크의 자료를 다운받는다. 다운로드 완료되면 자동설치된다.

 

https://marketplace.visualstudio.com/items?itemName=VisualMicro.ArduinoIDEforVisualStudio

 

Arduino IDE for Visual Studio - Visual Studio Marketplace

OverviewQ & ARating & Review ** 27th Sept 2019: Version 1909.27 or above is required for use alongside the Arduino IDE 1.8.10 ** License: 'Personal Use' from 30andCommercial/BusinessPerpetualUsefrom95 for one machine. Updates and assistance for p

marketplace.visualstudio.com

3. Arduino 설치

- Arduino와 기본 구성요소를 설치해주어야 한다.

- 기부할거면 기부하고 다운받고 하기 싫으면 그냥  Download 하면 된다.

 

https://www.arduino.cc/en/Main/Donate

 

Arduino - Donate

Consider supporting the Arduino Software by contributing to its development. UStaxpayers,pleasenotethiscontributionisnottaxdeductible. Learn more on how your contribution will be used. SINCE MARCH 2015, THE ARDUINO IDE HAS BEEN DOWNLOADED SO MA

www.arduino.cc

 

4. 환경설정

최초설치시 아래와 같은 Arduino 환경설정 화면이 나온다. 

- 설치된 Arduino IDE의 버전을 선택한다.

- 설치된 Arduino의 root 경로를 지정한다.

 

 

 

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 used9 1.91secs
Minimum Memory Usage: 298 bytes 15
 
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 probablym328p
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 2924bytes:
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.

 

728x90

댓글