Date: 10/08/09

Student Name: Hao (Hardy) He

TAs: Mike Pridgen

Thomas Vermeer

Instructors: Dr. A. Antonio Arroyo

Dr. Eric M. Schwartz

University of Florida

Department of Electrical and Computer Engineering

EEL 5666

Intelligent Machines Design Laboratory


Weekly Report 6


Collision avoidance has been achieved initially. The main part of the code is shown below
PORTD_OUT &= 0b11101011; // (B2,B1,A1,A2) = (0101), moving forward

PORTF_DIR |= 0x01; // F0 as output, connected to motors' STBY (standby)
PORTF_OUT |= 0x01; // disable STBY (H means not-standby)

ServoD0(50);
ServoD5(50);

PORTA_DIR &= 0xFE;  // A0 as input, connected to IR

while(1)
{
	temp = ADCA0();
	lcdGoto(1,0); lcdString("         ");
	lcdGoto(1,0); lcdInt(temp); // show the IR number from ADC
	if (temp > 2000)
	{
		PORTQ_OUT = 1; // turn on LED
		if (flag==1)
		{
			PORTD_OUT |= 0b00001100;
			PORTD_OUT &= 0b11101101; // (B2,B1,A1,A2) = (0110), turn right
			flag = 0;
		}
		else
		{
			PORTD_OUT |= 0b00010010;
			PORTD_OUT &= 0b11110011; // (B2,B1,A1,A2) = (1001), turn left
			flag = 1;
		}
	}
	else
	{
		PORTQ_OUT = 0;
	}
	delay_ms(1000);
	PORTD_OUT |= 0b00001010;
	PORTD_OUT &= 0b11101011; // (B2,B1,A1,A2) = (0101), moving forward
}

Currently I am still using the paper platform. I hope I can finish the formal platform design (using SolidWorks) within a week.