SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
서울창조경제혁신센터
창조경제 IoT 해커톤 대회
2015.9.12 ~ 9.13
2일차 교육
아두이노 소개
Arduino Products
Arduino Uno
https://www.arduino.cc/en/Main/ArduinoBoardUno
Arduino Uno
Reset
USB
USB to Serial
16MHz
ATmega328
DC Jack
Digital I/O Pin
Analog Input PinPower (5V, GND) Pin
ISP Pin
Arduino Uno
Arduino Uno
ATmega328
USB to Serial
Arduino Uno
여기서 잠깐!!!
온라인 부품 구매 https:// www.eleparts.co.kr
온라인 부품 구매 http://www.devicemart.co.kr
아두이노 개발환경
Arduino IDE : Sketch
Verify (Compile) Upload (to Arduino)
New (Source Code) Open (Source Code) Save (Source Code)
Serial Monitor (to PC)
파일 확장자 : *.ino
아두이노 예제 소스
Example : Blink
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Example : Blink
LED : 긴 다리
Example : Blink
Example : Fading (PWM)
int ledPin = 9; // LED connected to digital pin 9
void setup() {
//
}
void loop() {
// fade in from min to max in increments of 5 points:
for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
// fade out from max to min in increments of 5 points:
for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
}
Example : Fading (PWM)
100 : 255 = 75 : X
X = (255 x 75) / 100
X = 191.25
Example : Serial Monitor
void setup() {
// initialize serial communications baud rate.
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
Serial.println(“Hello IoT Hackathon!”); // write to PC monitor
delay(1000); // wait for a second
}
아두이노 함수 정리
#1
함수란?
• 변수 : 변하는 값
• 상수 : 변하지 않는 값
• 함수 : 두 변수 x, y에 대하여 x가 정해지면 그에 따라 y의 값이 하나만 결정될 때,
y를 x의 함수. y = f(x)
Arduino Language Reference
https://www.arduino.cc/en/Reference/HomePage
아두이노 함수 : 디지털 입출력
void pinMode(pin, mode)
• 매개변수
 pin : 설정하고자 하는 디지털 핀 번호
 mode : INPUT, OUTPUT, INPUT_PULLUP
• 반환 값 : 없음
void
명사
(격식 또는 문예체) (커다란) 빈 공간, 공동; 공허감
형용사
(격식) …이 하나도[전혀] 없는
(격식) 텅 빈 참고 null
int(Integer)
[명사] (수학) 정수(整數)
void digitalWrite(pin, value)
• 매개변수
 pin : 출력 신호를 내보낼 디지털 핀 번호
 mode : HIGH, LOW
• 반환 값 : 없음
int digitalRead(pin)
• 매개변수
 pin : 입력 신호를 읽어 올 디지털 핀 번호
• 반환 값 : HIGH, LOW
Share Knowledge & Share Spirit
유 명 환, funfun.yoo@gmail.com

Mais conteúdo relacionado

Mais procurados

원준갓의 IoT 수업
원준갓의 IoT 수업원준갓의 IoT 수업
원준갓의 IoT 수업
Won Jun Song
 
2 1. variables & data types
2 1. variables & data types2 1. variables & data types
2 1. variables & data types
웅식 전
 
TestBCD2013-2(answer)
TestBCD2013-2(answer)TestBCD2013-2(answer)
TestBCD2013-2(answer)
Yong Heui Cho
 

Mais procurados (20)

Aperture : 8. 스위치를 이용한 led 제어하기
Aperture : 8. 스위치를 이용한 led 제어하기Aperture : 8. 스위치를 이용한 led 제어하기
Aperture : 8. 스위치를 이용한 led 제어하기
 
Aperture : 7. 7세그먼트를 이용해 숫자 출력하기
Aperture : 7. 7세그먼트를 이용해 숫자 출력하기Aperture : 7. 7세그먼트를 이용해 숫자 출력하기
Aperture : 7. 7세그먼트를 이용해 숫자 출력하기
 
Aperture : 1. 아두이노에 대해 알아보기
Aperture : 1. 아두이노에 대해 알아보기Aperture : 1. 아두이노에 대해 알아보기
Aperture : 1. 아두이노에 대해 알아보기
 
손으로 만드는 아두이노
손으로 만드는 아두이노손으로 만드는 아두이노
손으로 만드는 아두이노
 
Aperture : 5. 초음파센서를 이용한 거리 측정하기
Aperture : 5. 초음파센서를 이용한 거리 측정하기Aperture : 5. 초음파센서를 이용한 거리 측정하기
Aperture : 5. 초음파센서를 이용한 거리 측정하기
 
TestBCD2016-2(Answer)
TestBCD2016-2(Answer)TestBCD2016-2(Answer)
TestBCD2016-2(Answer)
 
광운대[바람] 1.vhdl intro
광운대[바람] 1.vhdl intro광운대[바람] 1.vhdl intro
광운대[바람] 1.vhdl intro
 
광운대[바람] 2.vhdl 기본문법
광운대[바람] 2.vhdl 기본문법광운대[바람] 2.vhdl 기본문법
광운대[바람] 2.vhdl 기본문법
 
3D 프린터와 아두이노
3D 프린터와 아두이노3D 프린터와 아두이노
3D 프린터와 아두이노
 
원준갓의 IoT 수업
원준갓의 IoT 수업원준갓의 IoT 수업
원준갓의 IoT 수업
 
Verilog 모듈 연결하기
Verilog 모듈 연결하기Verilog 모듈 연결하기
Verilog 모듈 연결하기
 
P.E.S
P.E.SP.E.S
P.E.S
 
2 1. variables & data types
2 1. variables & data types2 1. variables & data types
2 1. variables & data types
 
메이커 페어 서울 2018 - 측우자격루(개발자용)
메이커 페어 서울 2018 - 측우자격루(개발자용)메이커 페어 서울 2018 - 측우자격루(개발자용)
메이커 페어 서울 2018 - 측우자격루(개발자용)
 
[2] 아두이노 활용 실습
[2] 아두이노 활용 실습[2] 아두이노 활용 실습
[2] 아두이노 활용 실습
 
데브루키 스터디 발표
데브루키 스터디 발표데브루키 스터디 발표
데브루키 스터디 발표
 
[C++ Korea 2nd Seminar] C++17 Key Features Summary
[C++ Korea 2nd Seminar] C++17 Key Features Summary[C++ Korea 2nd Seminar] C++17 Key Features Summary
[C++ Korea 2nd Seminar] C++17 Key Features Summary
 
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기
 
TestBCD2013-2(answer)
TestBCD2013-2(answer)TestBCD2013-2(answer)
TestBCD2013-2(answer)
 
TestBCD2018-2(answer)
TestBCD2018-2(answer)TestBCD2018-2(answer)
TestBCD2018-2(answer)
 

Destaque

우분투 한국 커뮤니티 나눔모임 발표 2013-02-23
우분투 한국 커뮤니티 나눔모임 발표 2013-02-23우분투 한국 커뮤니티 나눔모임 발표 2013-02-23
우분투 한국 커뮤니티 나눔모임 발표 2013-02-23
유명환 FunFun Yoo
 
운영체제 인트로
운영체제 인트로운영체제 인트로
운영체제 인트로
Junnie Jobs
 
서버 아키텍쳐 입문
서버 아키텍쳐 입문서버 아키텍쳐 입문
서버 아키텍쳐 입문
중선 곽
 

Destaque (20)

Why OpenStack is Operating System?
Why OpenStack is Operating System?Why OpenStack is Operating System?
Why OpenStack is Operating System?
 
[Codebakery 일반동아리] IoT의 개념 및 분야, 전망
[Codebakery 일반동아리] IoT의 개념 및 분야, 전망[Codebakery 일반동아리] IoT의 개념 및 분야, 전망
[Codebakery 일반동아리] IoT의 개념 및 분야, 전망
 
문돌이가 가르치는 서버사이드 PHP
문돌이가 가르치는 서버사이드 PHP문돌이가 가르치는 서버사이드 PHP
문돌이가 가르치는 서버사이드 PHP
 
IoT 해커톤 교육 3일차
IoT 해커톤 교육 3일차IoT 해커톤 교육 3일차
IoT 해커톤 교육 3일차
 
우분투 한국 커뮤니티 나눔모임 발표 2013-02-23
우분투 한국 커뮤니티 나눔모임 발표 2013-02-23우분투 한국 커뮤니티 나눔모임 발표 2013-02-23
우분투 한국 커뮤니티 나눔모임 발표 2013-02-23
 
운영체제 인트로
운영체제 인트로운영체제 인트로
운영체제 인트로
 
Tomcat monitoring using_javamelody
Tomcat monitoring using_javamelodyTomcat monitoring using_javamelody
Tomcat monitoring using_javamelody
 
[제5회 KCD] 한국에서 커뮤니티를 운영한다는 건...
[제5회 KCD] 한국에서 커뮤니티를 운영한다는 건...[제5회 KCD] 한국에서 커뮤니티를 운영한다는 건...
[제5회 KCD] 한국에서 커뮤니티를 운영한다는 건...
 
Hello std.io 유명환_20140125
Hello std.io 유명환_20140125Hello std.io 유명환_20140125
Hello std.io 유명환_20140125
 
문돌이가 가르치는 웹 프론트엔드 기초 2차시
문돌이가 가르치는 웹 프론트엔드 기초 2차시문돌이가 가르치는 웹 프론트엔드 기초 2차시
문돌이가 가르치는 웹 프론트엔드 기초 2차시
 
Intranet query tuning (example)
Intranet query tuning (example)Intranet query tuning (example)
Intranet query tuning (example)
 
사칙연산 프로그램
사칙연산 프로그램사칙연산 프로그램
사칙연산 프로그램
 
Online service 계층별 성능 모니터링 방안
Online service 계층별 성능 모니터링 방안Online service 계층별 성능 모니터링 방안
Online service 계층별 성능 모니터링 방안
 
Scale up and scale out
Scale up and scale outScale up and scale out
Scale up and scale out
 
숫자 구분자 처리 (Digit group separators)
숫자 구분자 처리 (Digit group separators)숫자 구분자 처리 (Digit group separators)
숫자 구분자 처리 (Digit group separators)
 
Java 개발자가 하드웨어를 만나게 된다면??
Java 개발자가 하드웨어를 만나게 된다면??Java 개발자가 하드웨어를 만나게 된다면??
Java 개발자가 하드웨어를 만나게 된다면??
 
서버 아키텍쳐 입문
서버 아키텍쳐 입문서버 아키텍쳐 입문
서버 아키텍쳐 입문
 
Web service performance_test_using_jmeter_ver1.2
Web service performance_test_using_jmeter_ver1.2Web service performance_test_using_jmeter_ver1.2
Web service performance_test_using_jmeter_ver1.2
 
프로그래밍 방식의 변천 과정
프로그래밍 방식의 변천 과정프로그래밍 방식의 변천 과정
프로그래밍 방식의 변천 과정
 
자바 직렬화 (Java serialization)
자바 직렬화 (Java serialization)자바 직렬화 (Java serialization)
자바 직렬화 (Java serialization)
 

Semelhante a 창조경제 IoT 해커톤 교육 2일차 교육 자료

아두이노로 배우는 피지컬 컴퓨팅(중급)
아두이노로 배우는 피지컬 컴퓨팅(중급)아두이노로 배우는 피지컬 컴퓨팅(중급)
아두이노로 배우는 피지컬 컴퓨팅(중급)
gongdigi24
 

Semelhante a 창조경제 IoT 해커톤 교육 2일차 교육 자료 (20)

라즈베리파이와 자바스크립트로 IoT 시작하기
라즈베리파이와 자바스크립트로 IoT 시작하기라즈베리파이와 자바스크립트로 IoT 시작하기
라즈베리파이와 자바스크립트로 IoT 시작하기
 
IoT with Raspberry Pi + Node JS - Chapter 2
IoT with Raspberry Pi + Node JS - Chapter 2IoT with Raspberry Pi + Node JS - Chapter 2
IoT with Raspberry Pi + Node JS - Chapter 2
 
아두이노와 Fpga를 이용한 로봇제작
아두이노와 Fpga를 이용한 로봇제작아두이노와 Fpga를 이용한 로봇제작
아두이노와 Fpga를 이용한 로봇제작
 
Test-SDIC2018-2(answer)
Test-SDIC2018-2(answer)Test-SDIC2018-2(answer)
Test-SDIC2018-2(answer)
 
허봉춘씨의 파란만장한 IoT 보드 만들기
허봉춘씨의 파란만장한 IoT 보드 만들기허봉춘씨의 파란만장한 IoT 보드 만들기
허봉춘씨의 파란만장한 IoT 보드 만들기
 
라즈베리파이 Circulus API 가이드
라즈베리파이 Circulus API 가이드라즈베리파이 Circulus API 가이드
라즈베리파이 Circulus API 가이드
 
Start io t_with_raspberrypi
Start io t_with_raspberrypiStart io t_with_raspberrypi
Start io t_with_raspberrypi
 
라즈베리파이 IoT 시작하기
라즈베리파이 IoT 시작하기라즈베리파이 IoT 시작하기
라즈베리파이 IoT 시작하기
 
NodeJs로 디바이스 통신하기
NodeJs로 디바이스 통신하기NodeJs로 디바이스 통신하기
NodeJs로 디바이스 통신하기
 
Meteor IoT
Meteor IoTMeteor IoT
Meteor IoT
 
Vr cctv 제작 ver1
Vr cctv 제작 ver1Vr cctv 제작 ver1
Vr cctv 제작 ver1
 
Arduino 특강 강태욱
Arduino 특강   강태욱Arduino 특강   강태욱
Arduino 특강 강태욱
 
사물인터넷 노트4_라즈베리파이기본
사물인터넷 노트4_라즈베리파이기본사물인터넷 노트4_라즈베리파이기본
사물인터넷 노트4_라즈베리파이기본
 
아두이노로 배우는 피지컬 컴퓨팅(중급)
아두이노로 배우는 피지컬 컴퓨팅(중급)아두이노로 배우는 피지컬 컴퓨팅(중급)
아두이노로 배우는 피지컬 컴퓨팅(중급)
 
학교장리더십(피지컬컴퓨팅)
학교장리더십(피지컬컴퓨팅)학교장리더십(피지컬컴퓨팅)
학교장리더십(피지컬컴퓨팅)
 
ARTIK 710 IoT class 02
ARTIK 710 IoT class 02ARTIK 710 IoT class 02
ARTIK 710 IoT class 02
 
컵드론 멀티콥터 펌웨어 분석 2015. 3.28.
컵드론 멀티콥터 펌웨어 분석 2015. 3.28.컵드론 멀티콥터 펌웨어 분석 2015. 3.28.
컵드론 멀티콥터 펌웨어 분석 2015. 3.28.
 
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
[KGC 2012]Boost.asio를 이용한 네트웍 프로그래밍
 
한글시계웍샵_ SW
한글시계웍샵_ SW한글시계웍샵_ SW
한글시계웍샵_ SW
 
TestBCD2016-1(Answer)
TestBCD2016-1(Answer)TestBCD2016-1(Answer)
TestBCD2016-1(Answer)
 

창조경제 IoT 해커톤 교육 2일차 교육 자료

  • 1. 서울창조경제혁신센터 창조경제 IoT 해커톤 대회 2015.9.12 ~ 9.13 2일차 교육
  • 5. Arduino Uno Reset USB USB to Serial 16MHz ATmega328 DC Jack Digital I/O Pin Analog Input PinPower (5V, GND) Pin ISP Pin
  • 10. 온라인 부품 구매 https:// www.eleparts.co.kr
  • 11. 온라인 부품 구매 http://www.devicemart.co.kr
  • 13. Arduino IDE : Sketch Verify (Compile) Upload (to Arduino) New (Source Code) Open (Source Code) Save (Source Code) Serial Monitor (to PC) 파일 확장자 : *.ino
  • 15. Example : Blink void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
  • 16. Example : Blink LED : 긴 다리
  • 18. Example : Fading (PWM) int ledPin = 9; // LED connected to digital pin 9 void setup() { // } void loop() { // fade in from min to max in increments of 5 points: for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) { // sets the value (range from 0 to 255): analogWrite(ledPin, fadeValue); // wait for 30 milliseconds to see the dimming effect delay(30); } // fade out from max to min in increments of 5 points: for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) { // sets the value (range from 0 to 255): analogWrite(ledPin, fadeValue); // wait for 30 milliseconds to see the dimming effect delay(30); } }
  • 19. Example : Fading (PWM) 100 : 255 = 75 : X X = (255 x 75) / 100 X = 191.25
  • 20. Example : Serial Monitor void setup() { // initialize serial communications baud rate. Serial.begin(9600); } // the loop function runs over and over again forever void loop() { Serial.println(“Hello IoT Hackathon!”); // write to PC monitor delay(1000); // wait for a second }
  • 22. 함수란? • 변수 : 변하는 값 • 상수 : 변하지 않는 값 • 함수 : 두 변수 x, y에 대하여 x가 정해지면 그에 따라 y의 값이 하나만 결정될 때, y를 x의 함수. y = f(x)
  • 24.
  • 25. 아두이노 함수 : 디지털 입출력 void pinMode(pin, mode) • 매개변수  pin : 설정하고자 하는 디지털 핀 번호  mode : INPUT, OUTPUT, INPUT_PULLUP • 반환 값 : 없음 void 명사 (격식 또는 문예체) (커다란) 빈 공간, 공동; 공허감 형용사 (격식) …이 하나도[전혀] 없는 (격식) 텅 빈 참고 null int(Integer) [명사] (수학) 정수(整數) void digitalWrite(pin, value) • 매개변수  pin : 출력 신호를 내보낼 디지털 핀 번호  mode : HIGH, LOW • 반환 값 : 없음 int digitalRead(pin) • 매개변수  pin : 입력 신호를 읽어 올 디지털 핀 번호 • 반환 값 : HIGH, LOW
  • 26. Share Knowledge & Share Spirit 유 명 환, funfun.yoo@gmail.com