336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

http://horrorcoding.altervista.org/arduino-development-with-eclipse-a-step-by-step-tutorial-to-the-basic-setup/


▲여기가 짧게 잘 정리되있다.


사용자가 사용하는 컴퓨터는 Windows 7 32bit PC이고, Arduino Duemilanove를 썼다.
Eclipse의 workspace 경로는 C:\Eclipse\eclipse-jee-mars-M1-win32\eclipse 이다.

사이트에 가면 알수있듯이 2가지 버젼이 있다.
1.6.6은 모든 보드에 사용할 수 있고
1.0.6은 Yun과 Due 빼고 모든 보드가 가능하다. (추천)

Arduino development with Eclipse – A step by step tutorial to the basic setup


>>
Install Eclipse
Java개발자가 아니므로 JRE를 다운받아서 쓰면 된다.
이클립스를 돌리기위해선 JRE가 필요하다.
오라클 웹사이트로 가서 Download누르고 내 시스템에 맞는 JRE를 고른다.
★ Accept를 누르고 Windows x86 Offline을 다운받는다.

First thing to do is download the latest Eclipse IDE for C/C++ developers 

from the Eclipse website, as I’m writing this the latest Eclipse version is Indigo.

To run Eclipse 

you need the Java Runtime Environment (not the JDK, because we are not going to develop in Java, so the JRE is fine), 

you can download the latest JRE from the Oracle website

click on the“Download” button under JRE, then choose the right JRE for your system, 

I downloaded the Win 32 x86 version

for offline installation (jre-7u3-windows-i586.exe).

Start Eclipse and choose a workspace, where all your Arduino projects will be saved.


▼이거 받아서 쓰셔도 됩니다.

jre-8u71-windows-i586.vol1.egg


jre-8u71-windows-i586.vol2.egg


jre-8u71-windows-i586.vol3.egg


jre-8u71-windows-i586.vol4.egg


jre-8u71-windows-i586.vol5.egg



>>

Install the Eclipse AVR Plugin

From Eclipse, go to Help and then Install New Software.

In the “Work with:” box write this url:

http://avr-eclipse.sourceforge.net/updatesite

▲이 주소 복사 붙여넣기 하기

Then click “Add”.
Set the “Name:” to Eclipse AVR Plugin, leave the “Location” as is.

이름써넣고, Location은 위의 URL을 붙여넣기한다.

Click OK and wait until the installable components are loaded, then select all and click Next, a dependencies check will start for the selected components and it should take some minutes.



After the depencencies check completes 

you will be asked to review the selected components, 

click Next, then accept the license terms and hit Finish

The components installation will start. 

An alert dialog will appear saying that you are installing unsigned software, say “OK”.

When the installation completes you will be asked to restart Eclipse.


>>

Download the Arduino SDK

SDK란 Software Development Kit 의 약자이다. 별 뜻 없다.

아두이노 사이트에서 ZIP파일을 다운받는다.

Download the latest Arduino SDK

at the time I am writing this the latest available SDK is marked asArduino 1.0

Needless to say, download the right one for your machine, 

I downloaded arduino-1.0-windows.zip.

Choose a place on your file system for the Arduino SDK and then unzip the downloaded file, 

I unzipped mine in D:\arduino so from now on remember to replace this base path with the one you choose.




>>

Setup the Eclipse AVR Plug-In

From Eclipse go to Window and then Preferences”, open the AVR section on the left, then select Paths

Select AVR-GCC, click “Edit”, in the window that appears set Path source:” to Custom, click “Browse” and point it to this path <arduino_base_path>\hardware\tools\avr\bin which is the path to the AVR compiler (avr-gcc.exe) inside the arduino SDK directory. 

I pointed mine to D:\arduino\hardware\tools\avr\bin.

이클립스에서 Window>>Preferences>>AVR>>Path

여기서 AVR-GCC선택, 오른쪽 Edit클릭

Path source를 Custom으로 세팅후

하단의 Browse클릭후 Custom으로 세부경로를 

arduino-1.6.6-windows\arduino-1.6.6\hardware\tools\avr\bin 여기까지 지정해준다.

Select GNU Make, click “Edit”, in the window that appears set “Path source:” to Custom, click “Browse” and point it to this path <arduino_base_path>\hardware\tools\avr\utils\bin which is the path to the makeexecutable inside the arduino SDK directory. I pointed mine to D:\arduino\hardware\tools\avr\bin.

반드시 utils/bin 의 경로로 지정해야한다.


Select AVR Header Files, click “Edit”, in the window that appears set “Path source:” to Custom, click “Browse” and point it to this path <arduino_base_path>\hardware\tools\avr\avr\include which is the path to the AVR toolchain headers files inside the arduino SDK directory. 

I pointed mine toD:\arduino\hardware\tools\avr\avr\include.


Select AVRDude, click “Edit”, in the window that appears set “Path source:” to “Custom”, click “Browse” and point it to this path <arduino_base_path>\hardware\tools\avr\bin which is the path to the AVRDude executable (used to deploy the binary on the Arduino board) inside the arduino SDK directory. I pointed mine to D:\arduino\hardware\tools\avr\bin.



Now the AVR plugin knows where to find the toolchain to build and deply code for the Arduino board.
Click Apply and then OK



>>

Create the ArduinoCore Library

The ArduinoCore library will contain all the basic functionalities 

to deal with the Arduino board, 

this library can be seen as the standard c library equivalent for Arduino. 

If you write some code for Arduino in the Arduino IDE, 

this library is silently linked to your code, 

but if you plan to use Eclipse 

you have to manually link the library to each of our projects 

before deploying them on the Arduino board.

(deploy:배포)
Here are the steps to create the ArduinoCore library (which is just the name I gave it):

From Eclipse go to New then C++ Project then AVR Cross Target Static Library and select Empty Project.

ArduinoCore의 library는 포함할것이다. 모든 기본 함수 기능들을

to다루기위해 the 아두이노 보드를,

이 라이브러리는 as 표준 C 라이브로리처럼 보인다. 동등한 for 아두이노에.

만약 네가 아두이노용 코드를 in Arduino IDE에서 쓴다면,

이 라이브러리는 조용히 linked된다 to 네 code에,

but 이클립스를 쓸 계획이라면

넌 have to 손수 링크해야한다. the library를 to 각각의 네 프로젝트들에

before deploying하기전에 그것을을 on the Arduino board상에.

여기 ArduinoCore의 library를 만드는 단계들이 있다.

File>>New>>Project에서 C/C++폴더로 들어가 C++ Project선택

AVR Cross Target Static Library폴더안의 Empty Project

상단의 Project 이름을 잘 적는다.(여기선 ArduinoCore라고 적었다.) 그리고 Next


Set the “Project Name:” to “ArduinoCore” and click Next.
This library will contain code distributed with the Arduino SDK which is considered to be stable, so deselect the Debug configuration and click Next.

Debug를 선택해제하고 Next.


Set the “MCU Type” and “MCU Frequency”, this depends on the specific board, my Arduino Duemilanove is equipped with an ATmega328P chip clocked at 16MHz (16000000 Hz). 

If you are not sure which values to use here, go to the arduino website in the “Hardware” section and click on your specific board to see the tech specs, here’s the link.
Once done hit “Finish”.




Now you have an empty library project, 

what we are going to do now is import the Arduino core files from the Arduino SDK folder.

이제 빈 라이브러리 프로젝트가 생겼다.

해야할건 import하기이다. the Arduino core 파일을 from the Arduino SDK 폴더로부터.

In Eclipse right click on the “ArduinoCore” project, 

select “Properties” and then “C/C++ Build”.
Open the “AVR Compiler” section and select Directories.
Add the include path to the arduino core header files in the Arduino SDK, 

they are located inside“<arduino_base_path>\hardware\arduino\cores\arduino”
Add the include path to the pins_arduino.h header file, this again depends on the specific board you are working with.
Many version of the pins_arduino.h header file can be found, they are located inside specific folders under“<arduino_base_path>\hardware\arduino\variants\”:

이클립스에서 우클랙해라. the "ArduinoCore" 프로젝트상에서,

우클릭>>Properties (단축키 Alt+Enter) >> C/C++ Build

>>Settins >> 오른편의 AVR Compiler>>Directories

여기서 include path를 추가한다. to the arduino core 해더파일들을 in the Arduino SDK에,

그 위치는 "<arduino_base_path>\hardware\arduino\cores\arduino”

내 컴퓨터에서의 위치는...

...C:\Eclipse\arduino-1.0.6-windows\arduino-1.0.6\hardware\arduino\cores\arduino

...C:\Eclipse\arduino-1.0.6-windows\arduino-1.0.6\hardware\arduino\variants 안의 시리즈들

(Standard, Mega, Leonardo, Micro)



  • <arduino_base_path>\hardware\arduino\variants\standard: I used this one for my Arduino Duemilanove
  • <arduino_base_path>\hardware\arduino\variants\mega: I guess you should use this one if you are working on an Arduino Mega board
  • <arduino_base_path>\hardware\arduino\variants\leonardo: maybe to be used with the new Arduino Leonardo board
  • <arduino_base_path>\hardware\arduino\variants\micro: absolutely dunno

Do the same for the “AVR C++ Compiler” section, then click “OK”.

From Eclipse right click on the “ArduinoCore” project, select “Import” and then “File System”. Point the file browser to the arduino core files directory inside the Arduino SDK which are located in“<arduino_base_path>\hardware\arduino\cores\arduino”.

AVR C++ Compiler에서도 같은 작업을 한다. OK를 누른다.

다시 원래대로 와서 ArduinoCore프로젝트를 우클릭하고 >> Import

File System이라고 타이핑하고 Next 클릭

Browse를 누르고 “<arduino_base_path>\hardware\arduino\cores\arduino”로 찾아간다.





Select all the files except main.cpp.

모두체크 main.cpp 빼고

Click on Advanced and select Create links in workspace so the files are not copied into the library but only weak-referenced. 

It’s better to only reference these files so 

if you download a newer version of the Arduino SDK 

you can simply overwrite the existing one and the ArduinoCore library is automatically updated.
Click Finish.


If everything went well you should now be able to build the ArduinoCore library, 

right click on the“ArduinoCore” project and do a “Build Project”.





>>

Create a Test Project

Let’s now create a test project to check that everything’s fine.
Remember that these steps must be done with every new project that you create.

In Eclipse go to New then C++ Project and then AVR Cross Target Application and select Empty Project.
Set the “Project Name:” to “TestProject” and click Next.


새로운 프로젝트를 만들어보자.  잘 되나 안되나 테스트해보자.

기억해야할건 위에서 했던 작업들을 매번 새 프로젝트를 만들어줄때마다 해야한다.

이클립스에서

File>>New>>Project>>C/C++ 안의 C++ Project 그리고 Next

AVR Cross Target Application안의 Empty Project선택후

위로와서 Projec name을 "TestProject"라고 세팅한후 Next.



Deselect the Debug configuration and click Next.
Set the “MCU Type” and “MCU Frequency” to the same values you set in the ArduinoCore library project and hit Finish.

Debug를 선택해제하고 Next.

MCU Type을 아두이노 칩에 맞줘서 설정

Frequency는 대체로 16MHz이다.



Right click on the “ArduinoCore” project, go to Properties 

and then C/C++ Build and in both “AVR Compiler” and “AVR C++ Compiler” 

add the same include paths that were added in the ArduinoCore library project 

plus the include path for the test project itself which
                        is not added by default 

and can be added 

with this magic string: “${workspace_loc:/${ProjName}}” 

which simply expands to your workspace directory followed by the test project directory.

우클릭한다. TestProject(새파일) 프로젝트에, >> Properties

여기서 C/C++ Build 안의 Settings를 누르고, 

오른편의 AVR Compiler>>Directories>>오른쪽위의 Add버튼

include path를 추가한다. 아까 ArduinoCore의 라이브러리 추가에서 했듯이

☆추가로 include path for 테스트 프로젝트 그자체를 위한

는 not 포함되지않는다.by default에 의해

and can be 추가될수있다.

with the magic string으로 "${workspace_loc:/${ProjName}}"

which 간단히 확장하는 to 너의 workspace 디렉토리에




From the “C/C++ Build” section in the “Properties” window go to “AVR C++ Linker”.
Set the command line pattern to:

C/C++ Build 섹션 >> Settings >> 오른편의 AVR C++ Linker에서

세팅히라. command line 패턴을 to ▼ 아래것으로

${COMMAND} --cref -s -Os ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} -lm ${FLAGS}



Now click on the “Libraries” subsection.

In the “Libraries path” box add the path to the ArduinoCore library 

by clicking on the “Add” button on the top right corner of the box, 

then select “Workspace” and point it to the “Release” folder inside the ArduinoCore project. You can also directly insert this magic string: 

“${workspace_loc:/ArduinoCore/Release}” which is the same thing.

In the “Libraries” box add the ArduinoCore library 

by clicking on the “Add” button on the top right corner of the box 

and simply type “ArduinoCore”

this instructs the linker to link against “libArduinoCore.a” 

when linking the final executable.

★AVR C++ Linker아래에 Libraries가 있다.★

이제 "Libraries" 서브섹션을 클릭한다.

In the "Libraries path" 박스안에서, 추가해라. the path를 to the ArduinoCore 라이브로리로

by 클릭함으로써 on the "Add"버튼을

then 선택해라. "Workspace"를 and지정해라.it to the"Release"폴더로inside the ArduinoCore내

넌 can 또한 바로 넣을수있다. 이 magic string을

${workspace_loc:/ArduinoCore/Release} which is the 같은걸로.

(☆Workspace>>ArduinoCore안의 Release폴더>>아래 OK버튼을 누르면 Directory에 자동으로 경로가 찍힌다.)

In the "Libraries"박스에서, 추가해라 the ArduinoCore 라이브러리를

by 클릭함으로써 on the Add 버튼을

and 간단히 타이핑해라. "ArduinoCore라고"

이건 지시한다. the Linker를 to 연결하라고 against "libArduinoCore.a"에 대응해서

when linking할때 the 최종 executable을.




In the project properties window, 

click on “Project references” in the left menu 

and check “ArduinoCore”, so the library will be automatically built (and re-built if needed) when building the test project.

In the test project create a new main.cpp file 

and paste the following code into it.
This is the classic Blink code sample that blinks the led linked on pin 13 of the Arduino board once every second:

프로젝트 properties window에서,

클릭해라.on "Project references"를 in the 왼편 menu안의

and 체크해라 "ArduinoCore"를 so the 라이브러리는 will be 자동으로 구축될것이다.

when 구축핼때 the test 프로젝트를.

In the test에서 프로젝트는 만든다. a 새로운 main.cpp파일을

and 붙여넣기해라. the 따라오는 코드를 in it에.

이건 the 전형적 Blink 코드 샘플이다. that 깜빡이게하는 the LED를



 
#include <Arduino.h>
 
int ledPin =  13;    // LED connected to digital pin 13
 
// The setup() method runs once, when the sketch starts
void setup()   {
  // initialize the digital pin as an output:
  pinMode(ledPin, OUTPUT);
}
 
// the loop() method runs over and over again,
// as long as the Arduino has power
 
void loop()
{
  digitalWrite(ledPin, HIGH);   // set the LED on
  delay(1000);                  // wait for a second
  digitalWrite(ledPin, LOW);    // set the LED off
  delay(1000);                  // wait for a second
}
 
 
int main(void) {
 
  init();
  setup();
 
  while(true) {
    loop();
  }
}

You’ll notice that there are some difference 

between this code and the usual code that you write for Arduino, 

the next post will focus on these differences, 

for now just take it as it comes. No questions. Or this post will never end.

넌 will 알아챌것이다. that there are some 차이점이있다는걸 

between 이 코드와 and 일반 코드 사이에서 that 네가 쓴 for Arduino용으로,

그 다음 포스트는 will 포커스를맞출것이다. on 이런 차이점들에 대해,

지금은 그저 이거나 취하자, 질문없이, or 이 포스트는 안끝날것이다.



Deploy on the Arduino board

After compiling and linking the binary 

a tool named AVRDude will deploy it on the Arduino board.
AVRDude must be configured to work with Arduino.
What we are going to do now is stealing the AVRDude configuration from the Arduino SDK.

컴파일링하고나서 and 연결하고나서 the binary를 

a 툴.. 이름붙여진 AVRDude라고 ..은 will 배포할것이다. 그걸 on the 아두이노 보드상에.

AVRDude는 must be 구성되야만한다. to 작업하기위해 with Arduino로.

뭘 우리가 할것인가... now ...는 stealing하기이다. the AVRDude 구성을 from the Arduino SDK로부터.

From Eclipse go to “Window” then “Preferences” and select the “AVR” section on the left, 

then select“AVRDude”.

Check “Use custom configuration file for AVRDude” 

and set “AVRDude config file” to the one provided with the Arduino SDK: 

it can be found under <arduino_base_path>\hardware\tools\avr\etc\avrdude.conf.
Click “Apply” and then “OK”.

이클립스에서 가라 to "Window"로 then "Preferences"로 그리고 택해라. the "AVR"을 on the 왼쪽에서,

then 선택해라. "AVRDude"를.

체크해라. "Use custom configuration file for AVRDude"를

and 세팅해라 "AVRDude config file"을 to the one으로 제공된 with the Arduino SDK:

이건 can be 찾을수있다. under <arduino_base_path>|hardware|tools|avr|etc|avrdude.conf.

클릭해라. "Apply"를 and then "OK"를 눌러라.



From Eclipse select the test project and open the project properties once more 

(right click->“Properties”).

Select the “AVR” section and the click on “AVRDude”
You now have to create a new programmer configuration for your board, 

this must be done only once.
Click “New”, in the window that appears insert these data:

이클립스에서 선택해라 .the 테스트 프로젝트를 and 열어라 the 프로젝트 properties를 한번

(우클릭 -> "Properties").

선택해라. the "AVR" 선택 and the 클릭 on "AVRDude"

넌 이제 have to 생성해야만한다. a 새로운 프로그래머 구성을 for 너의 보드를위해,

이건 must be 완료되야만한다. 일단.

클릭해라. "New"를, in the 윈도우에서 that 나타나는 insert these data가:

  • “Configuration Name” : “Arduino”
  • “Programmer Hardware” : “Arduino”
  • “Override default baudrate” : 57600

And set “Override default port” to the COM port that you use to work with the Arduino board. If you do not know what this value is, plug your Arduino board in and start the Default IDE, the COM port is showed at the bottom of the IDE window, my Arduino IDE says:

Arduino Duemilanove w/ ATMega328 on COM10

My COM port is COM10 so my “Override default port” field is set to:

//./COM10

Don’t ask me what the “//./” prefix means, I don’t know.
Click “OK”

Back in the “AVRDude” window select the “Advanced” tab.
Check “Disable Device signature check” and click “OK”.



First Deploy

It’s time. Plug your Arduino board in.

Select the test project and build it, then right click on it and select “AVR” 

and then “Upload project to target device”

the deploy will start and if everything’s fine you should have your program running on the Arduino board after a few seconds.

Look at the led at PIN 13 

and it should be blinking. Mine blinks.
That’s all, hope this guide is useful.
Again, let me know any problem you had so I can update the tutorial with your info.

이제 때가됬다. 플러그해라. 너의 Arduino 보드를 In으로.

택해라. the 테스트 프로젝트를 and build it해라. then 우클릭해라. on it and 택해라. "AVR"을

그런다음 "Upload project to target device",

그 deploy는 will 시작할것이다. and if 모든게 잘되면, 넌 should have 너의 프로그램을 돌아가는 on the 아두이노 보드상에서 after a few seconds후에.

봐라. at the LED를 at PIN 13을

그리고 그건 should be 깜빡이고있을것이다. 내껀 깜빡인다.

그게 전부다. 이 가이드가 유용하길 바란다.

다시금, 내게 알려줘 뭔 문제가 있으면 so 난 can 업데이트할수있다. the 튜토리얼을 with 너의 정보로.

-------------------------------------------------------------

환경변수 : 내컴퓨터 우클릭 >> 속성 >> 시스템 보호 >> 고급>> 환경변수

C:\Eclipse\Binary_Program\GnuWin32\bin

여기 경로로 설정

'Arduino > Arduino + Eclipse Plug-In' 카테고리의 다른 글

Program Arduino with Eclipse  (0) 2016.01.26
Using Arduino in Eclipse (한글)  (0) 2016.01.24
Posted by ElectricShock
:
BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
Programming(=프로그래밍) (3)
MiDi (2)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백