SlideShare a Scribd company logo
1 of 14
아두이노 X 레고 실습
1. 전자회로 기본
2. 아두이노 시작
3. 실행 테스트
4. LED 제어
5. 디버깅
6. 모터 제어
7. 아두이노 X 레고 자동차 제작
목 차
1. 전자회로 기본
저항 읽는 법
이미지 출처 :
http://ggolbeng2.tistory.com/m/entry/%EC%A0%80%ED%95%AD-
%EC%9D%BD%EB%8A%94-%EB%B2%95
1. 전자회로 기본
브레드보드(Breadboard)
이미지 출처 : http://www.makeshare.org/bbs/board.php?bo_table=Parts&wr_id=46
1. 전자회로 기본
다이오드(Diode)
이미지 출처 :
http://ggolbeng2.tistory.com/m/entry/%EC%A0%80%ED%95%AD-
%EC%9D%BD%EB%8A%94-%EB%B2%95
1. 전자회로 기본
회로도 그리기
이미지 출처 : 직접 제작(Fritzing 사용)
2. 아두이노 시작
아두이노 - PC 연결
PC 연결 및 IDE 실행
IDE(Sketch) 실행
확인: 소스 컴파일
업로드: 컴파일 및 보드에 업로드
setup():
초기 설정값 세팅
loop():
메인 코드.
반복적으로 실행되는 부분
3. 실행 테스트
아두이노 내장 LED 깜빡이게 하기
Sketch > 파일 > 예제 > 01.Basics > Blink
https://blog.naver.com/pcmola/220994674589 참고
아두이노 버전 Hello, world
LED 깜빡이게 하기
4. LED 제어
다음과 같이 회로 구성 후, 이전 소스(Blink) 재활용
https://blog.naver.com/pcmola/220997292383 참고
특정 PIN 번호 활용
4. LED 제어
8번 핀을 OUTPUT으로 세팅.
소스 및 회로도
void setup() {
pinMode(8, OUTPUT);
}
void loop() {
digitalWrite(8, HIGH);
delay(1000);
digitalWrite(8, LOW);
delay(1000);
}
디버깅: 시리얼 출력 확인
5. 디버깅
시리얼 모니터로 출력하기
void setup() {
pinMode(8, OUTPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(8, HIGH);
Serial.println(HIGH);
delay(1000);
digitalWrite(8, LOW);
Serial.println(LOW);
delay(1000);
}
모터 쉴드 활용
6. 모터 제어
아두이노 위에 모터 쉴드 연결
https://blog.naver.com/pcmola/221464193741 참고
void setup() {
pinMode(5, OUTPUT); // 5번핀을 출력모드로 설정한다(PWM).
pinMode(4, OUTPUT); // 4번핀을 출력모드로 설정한다(DIR).
}
void loop() {
analogWrite(5, 255); // Motor 회전
digitalWrite(4, HIGH); // Motor 정방향
delay(2000); // 2초 유지
analogWrite(5, 0); // Motor 정지
delay(500); // 0.5초 유지
analogWrite(5, 255); // Motor 회전
digitalWrite(4, LOW); // Motor 역방향
delay(2000); // 2초 유지
analogWrite(5, 0); // Motor 정지
delay(2000); // 2초 유지
}
아두이노로 레고 자동차 작동시키기
7. 아두이노 X 레고 자동차 제작
레고 조립설명서: 별도 배부
https://blog.naver.com/pcmola/221641197608 참고
End Of Document

More Related Content

Featured

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

아두이노 X 레고 실습

  • 2. 1. 전자회로 기본 2. 아두이노 시작 3. 실행 테스트 4. LED 제어 5. 디버깅 6. 모터 제어 7. 아두이노 X 레고 자동차 제작 목 차
  • 3. 1. 전자회로 기본 저항 읽는 법 이미지 출처 : http://ggolbeng2.tistory.com/m/entry/%EC%A0%80%ED%95%AD- %EC%9D%BD%EB%8A%94-%EB%B2%95
  • 4. 1. 전자회로 기본 브레드보드(Breadboard) 이미지 출처 : http://www.makeshare.org/bbs/board.php?bo_table=Parts&wr_id=46
  • 5. 1. 전자회로 기본 다이오드(Diode) 이미지 출처 : http://ggolbeng2.tistory.com/m/entry/%EC%A0%80%ED%95%AD- %EC%9D%BD%EB%8A%94-%EB%B2%95
  • 6. 1. 전자회로 기본 회로도 그리기 이미지 출처 : 직접 제작(Fritzing 사용)
  • 7. 2. 아두이노 시작 아두이노 - PC 연결 PC 연결 및 IDE 실행 IDE(Sketch) 실행 확인: 소스 컴파일 업로드: 컴파일 및 보드에 업로드 setup(): 초기 설정값 세팅 loop(): 메인 코드. 반복적으로 실행되는 부분
  • 8. 3. 실행 테스트 아두이노 내장 LED 깜빡이게 하기 Sketch > 파일 > 예제 > 01.Basics > Blink https://blog.naver.com/pcmola/220994674589 참고 아두이노 버전 Hello, world
  • 9. LED 깜빡이게 하기 4. LED 제어 다음과 같이 회로 구성 후, 이전 소스(Blink) 재활용 https://blog.naver.com/pcmola/220997292383 참고
  • 10. 특정 PIN 번호 활용 4. LED 제어 8번 핀을 OUTPUT으로 세팅. 소스 및 회로도 void setup() { pinMode(8, OUTPUT); } void loop() { digitalWrite(8, HIGH); delay(1000); digitalWrite(8, LOW); delay(1000); }
  • 11. 디버깅: 시리얼 출력 확인 5. 디버깅 시리얼 모니터로 출력하기 void setup() { pinMode(8, OUTPUT); Serial.begin(9600); } void loop() { digitalWrite(8, HIGH); Serial.println(HIGH); delay(1000); digitalWrite(8, LOW); Serial.println(LOW); delay(1000); }
  • 12. 모터 쉴드 활용 6. 모터 제어 아두이노 위에 모터 쉴드 연결 https://blog.naver.com/pcmola/221464193741 참고 void setup() { pinMode(5, OUTPUT); // 5번핀을 출력모드로 설정한다(PWM). pinMode(4, OUTPUT); // 4번핀을 출력모드로 설정한다(DIR). } void loop() { analogWrite(5, 255); // Motor 회전 digitalWrite(4, HIGH); // Motor 정방향 delay(2000); // 2초 유지 analogWrite(5, 0); // Motor 정지 delay(500); // 0.5초 유지 analogWrite(5, 255); // Motor 회전 digitalWrite(4, LOW); // Motor 역방향 delay(2000); // 2초 유지 analogWrite(5, 0); // Motor 정지 delay(2000); // 2초 유지 }
  • 13. 아두이노로 레고 자동차 작동시키기 7. 아두이노 X 레고 자동차 제작 레고 조립설명서: 별도 배부 https://blog.naver.com/pcmola/221641197608 참고