/****************************************************
 *  LineMonitor.c                                         
 *  Created on: 2012/04/17 11:47:57                      
 *  Implementation of the Class LineMonitor       
 *  Original author: hiroyuki.watanabe                     
 ****************************************************/

#include "ecrobot_interface.h"
#include <string.h>
#include <stdlib.h>

#include "LineMonitor.h"
#define THRESHOLD  560
#include "LightSensor.h"

IsOnLine LineMonitor_judgeLine(LineMonitor* this)
{
	unsigned int brightness = LightSensor_getBrightness(this->lightSensor);
	
	IsOnLine result;
	if(brightness < THRESHOLD)
	{
		result = ON_LINE;
	}
	else
	{
		result = OUT_OF_LINE;
	}
	
	return result;
} 




