<commit_before>/* An abstract class to represent a SHARP infrared sensor. Attaches itself to an analog pin that is set as an input. */

#include "Smartcar.h"

SHARP_IR::SHARP_IR(){
	_sensorMedianDelay = 15; //median delay for all the sharp infrared sensors
}

void SHARP_IR::attach(unsigned short pin){
	_pin = pin;
	pinMode(_pin, INPUT);
}

unsigned int SHARP_IR::getDistance(){
	unsigned int distance = voltsToCentimeters(readAnalogInput());
	if ((distance < _minDistance) || (distance > _maxDistance)){
		return 0;
	}
	return distance;
}

unsigned int SHARP_IR::readAnalogInput(){
	return analogRead(_pin);
}<commit_msg>updating the median delay time of SHARP infrared's according to response time of datasheets<commit_after>/* An abstract class to represent a SHARP infrared sensor. Attaches itself to an analog pin that is set as an input. */

#include "Smartcar.h"

SHARP_IR::SHARP_IR(){
	_sensorMedianDelay = 39; //median delay for all the sharp infrared sensors
}

void SHARP_IR::attach(unsigned short pin){
	_pin = pin;
	pinMode(_pin, INPUT);
}

unsigned int SHARP_IR::getDistance(){
	unsigned int distance = voltsToCentimeters(readAnalogInput());
	if ((distance < _minDistance) || (distance > _maxDistance)){
		return 0;
	}
	return distance;
}

unsigned int SHARP_IR::readAnalogInput(){
	return analogRead(_pin);
}
{'fraction_non_alphanumeric': 0.10649546827794562, 'fraction_numerical': 0.004531722054380665, 'mean_word_length': 5.3701923076923075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3693638', 'n_tokens_mistral': 452, 'n_tokens_neox': 410, 'n_words': 141}