프로젝트/KityRobotCar Project(아두이노) (2) 썸네일형 리스트형 KityRobot Car 소스코드 L239D 모터 쉴드는 M1 M2 M3 M4 Servo1 Servo2를 제어 할수 있다. 위 핀맵은 사용하는 모터에 따른 이용 가능한 디지탈 핀을 나타내고 있다. 아날로그는 모두 사용 가능 여기서는 M3 M4 모터를 사용하니 사용 가능한 디지탈 핀은 2,3,9,10,11,13번 핀이다. 아래의 코드를 보면 센서들이 이 번호를 사용 하고 있을 것이다. 참고로 디지탈 핀이 많이 필요하면 Mega나 쉬프트 레지스터를 이용하면 된다. #include // L293D 모터 드라이브 라이브러리 #include // I2C 통신을 위한 라이브러리 #include // LCD 1602 I2C용 라이브러리 LiquidCrystal_I2C lcd(0x27,16,2); // 접근주소: 0x3F or 0x27 // SDA A.. KityRobot Car 소개 시간이 날때마다 조금씩 코드를 만들고 있는 KityRobotCar입니다. 재미로 함 보시고 코드는 다른페이지에 계속 업데이트 중입니다. https://youtu.be/e4kd8OVqPSw 전방 적외선 거리센서 : 장애물 감지 ( 초음파보다 안정적임 ) 좌측 우측 적외선 센서 : 장애물 탐지 보조 아래쪽 적외선 센서 : 절벽 탐지( 책상 모서리에 오면 멈춤 ) LCD1602 L293D 모터드라이브 전원 On IR 센서에 손을 가까이 하면 시동 전방에 장애물이나 낭떨어지면 뒤로 후퇴후 회전후 전진 좌측에 장애물 감지하면 반시계방향 회전후 전진 우측에 장애물 감지하면 시계방향 회전후 전진 이전 1 다음