Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- C언어 #포인터 #배열 #코딩 #개발 #프로그래밍
- 백준
- 클론코딩
- 코뮤니터_코딩챌린지
- 코뮤니티
- 파이썬
- 코코아클론
- 동아리
- 회고
- 알고리즘은 너무나도 행복하다
- 실리콘밸리
- 살려주세요
- 모각코
- 니콜라스
- 개발자
- 검색알고리즘
- 알고리즘
- 대회
- 꾸준함
- 파이어베이스
- 화이팅
- 파이썬 #프로그래밍 #학생
- 설정
- 예약사이트
- 아두이노
- 코뮤니티_코딩챌린지
- 고등학교에서 살아남기
- 노마드코더
- 코딩
- c #c언어 #포인터 #코딩 #프로그래밍 #코딩이 진리다 #개발자
Archives
- Today
- Total
wau2380's playground
[모각코 아두이노] 15일차 / RC카 후기 본문
프로젝트 이름 : 스마트 RC카
프로젝트 소개 및 설명 : RC카를 아두이노로 제작, RC카를 스마트폰으로 조종하려고 했으나 시간이 안되서
움직이만 구현함
회로 구성 설명 (사진 포함)
코드 설명 (코드 포함)
int RightMotor_E_pin = 5; // 오른쪽 모터의 Enable & PWM
int RightMotor_1_pin = 8; // 오른쪽 모터 제어선 IN1
int RightMotor_2_pin = 9; // 오른쪽 모터 제어선 IN2
int LeftMotor_3_pin = 10; // 왼쪽 모터 제어선 IN3
int LeftMotor_4_pin = 11; // 왼쪽 모터 제어선 IN4
int LeftMotor_E_pin = 6; // 왼쪽 모터의 Enable & PWM
void SmartCar_Go();
void SmartCar_Back();
int E_carSpeed = 153; // 최대 속도의 60 %
void setup() {
pinMode(RightMotor_E_pin, OUTPUT); // 출력모드로 설정
pinMode(RightMotor_1_pin, OUTPUT);
pinMode(RightMotor_2_pin, OUTPUT);
pinMode(LeftMotor_3_pin, OUTPUT);
pinMode(LeftMotor_4_pin, OUTPUT);
pinMode(LeftMotor_E_pin, OUTPUT);
}
void loop() {
SmartCar_Go();
delay(3000);
SmartCar_Back();
delay(3000);
}
void SmartCar_Go() { // 전진
Serial.println("Forward");
digitalWrite(RightMotor_1_pin, HIGH);
digitalWrite(RightMotor_2_pin, LOW);
digitalWrite(LeftMotor_3_pin, HIGH);
digitalWrite(LeftMotor_4_pin, LOW);
for (int i = 0; i <= E_carSpeed; i = i + 5) {
analogWrite(RightMotor_E_pin, i);
analogWrite(LeftMotor_E_pin, i);
delay(20);
}
}
void SmartCar_Back() { // 후진
Serial.println("Backward");
digitalWrite(RightMotor_1_pin, LOW);
digitalWrite(RightMotor_2_pin, HIGH);
digitalWrite(LeftMotor_3_pin, LOW);
digitalWrite(LeftMotor_4_pin, HIGH);
for (int i = 0; i <= E_carSpeed; i = i + 5) {
analogWrite(RightMotor_E_pin, i);
analogWrite(LeftMotor_E_pin, i);
delay(20);
}
}
문제점 & 어떻게 문제를 해결했나요?
그.. 나사를 조이는데 너무 성급해서 나사구멍이 헐어서 결국 본드로 붙여버렸네요.
다음부턴 조급해하지 않는 마음을 길러야겠어요.
프로젝트 디자인 소개 (사진 포함)
프로젝트 작동 영상
너무 재밌었습니다. 아두이노 만드는 동안 인내심을 많이 시험당하긴 했지만
그래도 결과물이 있으니까요.
아무쪼록, 코뮤니티 모각코에 아두이노 많은 지원 부탁드립니다.
게시글 : https://cafe.naver.com/codeuniv/46607
코뮤니티 : https://cafe.naver.com/codeuniv
'모각코 > 아두이노' 카테고리의 다른 글
[모각코 아두이노] 7일차 / 서브모터 (0) | 2021.09.26 |
---|---|
[모각코 아두이노] 6일차 / 초음파 센서 (0) | 2021.09.26 |
[모각코 아두이노] 5일차/ LED & RGB (0) | 2021.09.26 |
[모각코 아두이노] 4일차 / 라이브러리 사용법 (0) | 2021.09.21 |
[모각코 아두이노] 3일차 / LED 켜기 (0) | 2021.09.13 |