
-----------------------------------
cwlvc
Sat Dec 13, 2008 6:22 pm

does this program loop forever?
-----------------------------------
#include 
/* cRandom.c

Hardware Notes:
		Outputs:
		RA0 - Connected to D0 Input for Motor 1 (left wheel)
		RA1 - Connected to D1 Input for Motor 1 

		RC0 - Connected to D2 Input for Motor 2 (right wheel)
		RC1 - Connected to D3 Input for Motor 2 

		Inputs:
		NONE

Anson Mo, Harnish 
December 16, 2008
*/
// ----------------------------------------------------------
//setup

//config statement
 __CONFIG(INTIO & WDTDIS & PWRTEN & MCLRDIS & UNPROTECT & BORDIS & IESODIS & FCMDIS);

//declare variables
int i, j;
char counter;

// ----------------------------------------------------------

// mainline of cRandom.c
main()
{
	CMCON0 = 7;						//Turn off all Comparators
	ANSEL = 0;						//Teach all ports to be digital

	
	TRISA = 0b001000;				// Teach all PORTA to be outputs except RA3(input)
	TRISC = 0b000000;				// Teach all PORTC to be outputs.

		while (1==1) 
		{
			// move robot forward by making the left motor and right motor move in direct A
			PORTA = 0b000001;	// Teach RA0 to be on consequently making D0 of the left motor on and thus 
								// making it turn in Direction A (forward).

			PORTC = 0b000001;	// Teach RC0 to be on consequently making D0 of the right motor on and thus 
								// making it turn in Direction A (forward)
			for(counter = 0; counter