----------**Project Readme**------------


/*
 * Author Info
 * unityID	firstname		lastname
 * adave	Aakash			Dave
 *
 */

The project working is explained in detail in the report.In brief this code implements a controller and bot on seperate nxt's connected via bluetooth.Load controller program(btmaster) to a nxt and bot program(btslave) to the bot.
Start bot first and ensure the light sensors are up.Then run the program on controller and wait until a [BT] sign is displayed on bot NXT's.
Given input and push start.The bot should start following the line on the track based on user input and wait at a given location before continuing to follow the track.


BTmaster/Controller
(btmaster.c)
This is the controller which acts as a master and initiates all communication with bot.User enter input for the bot using touch sensors used to emulate various types of values like location and turn.

Configuration -
Port S1 - Input location counter  2-200; reserved 1-reached location 0-default wait condition
Port S2 - Input Turn  1- left/2-right
Port S3 - Start button



BTslave/Bot
(btslave.c)
The bot is 3 wheeled 2 motor design with sensors in the front and another in the center to detect location.
Refer to config.h for port configuration and light thresholds.

In code the event handler implements the default stop condition until a bluetooth connection is establish and input recieved from the controller.
Once the input is recieved it check the counter value and start following the line.Once a branch is detected it makes a turn based on input and then starts to look for location marker on the track.Once a location match is found it stops following the line and waits for 1000ms as a counter value indication on the lcd.Along with the recieved input light values from sensors is also displayed at all times so as to ensure proper opertation


Many debug values are displayedo on the lcd for test.Refer comments in code for any queries regarding to logic and debug variables displayed
See report for track design and other details.


The programs used as reference are the nxtOSEK sample programs


Notes:

The program has to be placed in nxt-setup/lejos-oek/nxtOSEK/samples_c/ before doing make
Makefile paths are relative to this path

set the environment variables
setenv GNUARM_ROOT to /usr/local/gnuarm 
setenv NEXTTOOL_ROOT to the path of NeXTTool executable


