[창의적공학설계] Battle Robot 설계
- 등록일 / 수정일
- 페이지 / 형식
- 자료평가
- 구매가격
- 2010.09.27 / 2019.12.24
- 13페이지 / hwp (아래아한글2002)
- 평가한 분이 없습니다. (구매금액의 3%지급)
- 1,400원
최대 20페이지까지 미리보기 서비스를 제공합니다.
자료평가하면 구매금액의 3%지급!
1
2
3
4
5
6
7
8
9
10
11
12
13
추천 연관자료
- 목차
-
1.
서 론
1) 프로젝트 목표
- 로봇대회의 설명
- 로봇대회의 목표
- 조원들의 목표
2) 프로젝트 진행과정 및 역할분담
2.
본 론
· 1) 로봇 알고리즘
2) 로봇 디자인
3.
결 론
1) 알고리즘 구현 코드
2) 결론
3) 참고문헌
- 본문내용
-
4-3) 로봇 디자인 문제점
① 터치센서가 전방범퍼에 연결 되어있어 범퍼가 눌리지 않으면 알고리즘을 실행할 수 없음
② 다른조에 비해 로봇의 무게가 가벼워 쉽게 밀림
③ 측면을 보호해주는 장치가 없음 (고무바퀴뿐)
5. 알고리즘 구현 코드
#include "NXCdefs.h"
#define BLACK(x) (x>0 && x<=36 ? true : false)
#define BLACKGREEN(x) (x>40 && x<=50 ? true : false)
#define GREEN(x) (x>50 && x<=54 ? true : false)
#define WHITE(x) (x>=58 && x<100 ? true : false) //57?
#define back(x) OnFwd(OUT_BC, 100); Wait(x); Off(OUT_ABC);
#define go(x) OnRev(OUT_BC, 100); Wait(x); Off(OUT_ABC);
//#define backspin(x) OnFwd(OUT_BC, 100); Wait(x); RotateMotor(OUT_A, 50, 20); OnRev(OUT_BC, 100); Wait(x/2); RotateMotor(OUT_A, 50, -40); OnRev(OUT_BC, 100); Wait(x/2); RotateMotor(OUT_A, 50, 20); Off(OUT_ABC);
//#define backspin(x) OnFwd(OUT_BC, 100); Wait(x); RotateMotor(OUT_A, 50, 20); OnRev(OUT_BC, 100); Wait(x); Off(OUT_ABC);
#define RightCurve Off(OUT_BC); RotateMotor(OUT_A, 50, -30); RotateMotor(OUT_BC, -100, 320); RotateMotor(OUT_A, -50, -30); RotateMotor(OUT_BC, 100, 200); Off(OUT_ABC);
#define LeftCurve Off(OUT_BC); RotateMotor(OUT_A, -50, -30); RotateMotor(OUT_BC, -100, 320); RotateMotor(OUT_A, 50, -30); RotateMotor(OUT_BC, 100, 200); Off(OUT_ABC);
#define backspin(x) OnFwd(OUT_BC, 100); Wait(x); RightCurve; OnRev(OUT_BC,100); Wait(x); LeftCurve; OnRev(OUT_BC,100); Wait(x); LeftCurve; OnRev(OUT_BC,100); Wait(x); Off(OUT_ABC);
#define SECOND 500 //1초를 계산하는 루프 타임
#define HISTORY_NUM 5
#define START 0
#define SEARCH 1
#define ARRIVE 2
#define DEFENSE 3
#define ATTACK_1 4
#define ATTACK_2 5
task main(){
int light_sensor;
int history[HISTORY_NUM];
int his_num=0;
int history_temp=0;
int state = START;
int state_time = 0;
int defense_time = 0;
int i;
int angle=0;
bool is_start=true;
bool is_curve=true;
int find_green=1;
int find_black=0;
int rotate_1;
int rotate_2;
Off(OUT_ABC); //모든 모터 멈춤
SetSensorLight(IN_3); //라이트 센서 설정
SetSensorTouch(IN_1); //터치 센서 설정
SetSensorTouch(IN_2); //터치 센서 설정
light_sensor=SENSOR_3;
for(i=0; i<HISTORY_NUM; i++){
history[i]=light_sensor;
}
while(true){
- 참고문헌
-
- 이클래스 자료실
- Google 검색
자료평가
-
아직 평가한 내용이 없습니다.