무판자로 되있는 미로 (소나센서만 이용) 길찾는건데 일단 코드 던질게
수정해야할 부분은 그렇게 많지 않음/대신 기본틀은 유지한 채로 코드 작성해야함.
용돈 벌고싶으면 물어라. 계약금은 없고 중도금으로 5000원 완료금 10000원 쏠게. 이런걸로 장난 안해
카톡아이디는 AbleSong 친추해줘~
#pragma config(Sensor, S1, sonar, sensorSONAR)
#pragma config(Sensor, S2, light, sensorLightActive)
#pragma config(Sensor, S3, touch, sensorTouch)
#pragma config(Sensor, S4, touch, sensorTouch)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
const int cellSize = 40; // the width and depth of each cell in MAZE is equal to 40 cm
const int speed = 20; // robot's basic motor power level
// with P controller, the max power level could be 40 percent
const int thresholdForPath = cellSize - 10; // should consider some noise while reading from sonar
// this variable is used in movement.h file
#include "odometry.h"
#include "sonarCorrection.h"
/********************************************************************************************************
int getSonarValue(); // e = error r = within a range
void correctSonarError(int e, int r); // so, when testing your sonar sensor,
if your sonar sensor has more than 3 within 23 cm,
then, correctSonarError(3, 23);
*********************************************************************************************************/
#include "movement.h"
/********************************************************************************************************
void forward(int cm);
void turnRight();
void turnLeft();
void turnAround();
void getMapInfoFromSonar(bool &lPath, bool &fPath, bool &rPath);
*********************************************************************************************************/
task main()
{
bool leftPath = false;
bool rightPath = false;
bool fr>
initRobot(13.7, 0, 0, 180);
correctSonarError(3, 23);
//StartTask(odometry); // if you need to localize your robot, you can use this function.
while( 1 )
{
getMapInfoFromSonar(leftPath, frontPath, rightPath);
if( leftPath )
{
// since there is a path on your left hand side,
// so your robot should go to the left. How can you make this happen?
// HINT : use turnLeft and forward function.
}
else if( rightPath )
{
}
else if( frontPath )
{
}
else // facing a dead end so your robot has to turn around
{
}
}
//StopTask(odometry);
}
너 엄마한테 전화해서 대출하라고해 3650원중에서 이자가 3만원이라고 충분히 할수있잖아 연습하고해ㅅㅅ꺄
뭐래 ㅉㅉ
앜ㅋㅋ 고작 5000원하고 1만원 받자고 이걸 짜주느니 그냥 내 할일을 하겠다ㅋㅋㅋㅋ
솔직히 금방 끝나잖아요 ㅠㅠ
쉽게짜면 금방이고 고난도로 짜면 좀 걸리지. 패스 메모리 기능 유무에 따라 달라질듯
프갤럼님 고난도로 짜줄필요는 없어요... 가능하면 좀 부탁드려요~ 입금 꼬꼬 할게요 ㅋㅋㅋ
귀차나 내 프로젝트도 감당 못하고 패닉상태인데 뭔 남의것을 하겠어. 그냥 왼쪽 감지되면 오른쪽으로 90도, 오른쪽 감지되면 왼쪽으로 90도, 앞에 감지되면 180도 회전 넣어 그럼 앵간하면 다 될꺼야
패스 메모리 하기엔 마인드스톰이 성능이 안될것같네.
아 모르겠는데... 프갤럼님 도전?!!
위안화랍니다.
모르겠으면 하지마 때려쳐
ㅋㅋㅋㅋㅋㅋㅋㅋ