예제 #1
0
/*******************************************************************
* Function:			void checkIR(void)
* Input Variables:	none
* Output Return:	none
* Overview:			This function update all of the infrared range
*					finding sensor values sequentially
********************************************************************/
void checkIR( void )
{
	// Update all IR values
	ftIR = getFrontIR();
	bkIR = getBackIR();
	ltIR = getLeftIR();
	rtIR = getRightIR();
}
예제 #2
0
void getIR()
{
	ft = getFrontIR();
	bk = getBackIR();
	rt = getRightIR();
	lt = getLeftIR();
	frontRight = ATTINY_get_IR_state(ATTINY_IR_RIGHT);
	frontLeft =  ATTINY_get_IR_state(ATTINY_IR_LEFT);
}
예제 #3
0
파일: Project.c 프로젝트: ruffsl/ECE425
/*******************************************************************
* Function:			void moveCollide(void)
* Input Variables:	none
* Output Return:	none
* Overview:			Use a comment block like this before functions
********************************************************************/
void moveCollide( void )
{
	ftIR = getFrontIR();
	// Check front IR sensor
	if(ftIR > IR_THRESHOLD)
	{
		// Move forward.
		STEPPER_move_stnb( STEPPER_BOTH, 
		STEPPER_FWD, 200, 200, 450, STEPPER_BRK_OFF, // Left
		STEPPER_FWD, 200, 200, 450, STEPPER_BRK_OFF ); // Right
	}

	else
	{
		//STOP.
		STEPPER_move_stnb( STEPPER_BOTH, 
		STEPPER_FWD, 0, 0, 0, STEPPER_BRK_OFF, // Left
		STEPPER_FWD, 0, 0, 0, STEPPER_BRK_OFF ); // Right
	}
}