<commit_before>#include "thermistor-library.h"

Thermistor::Thermistor(int pin, int resistor) {
	_pin = pin;
	_resistor = resistor;
}


void Thermistor::begin(void) {
	pinMode(_pin, INPUT);
}


int Thermistor::getTempRaw(bool smooth=false) {
	delay(1);
	
	if(smooth==true) {
		int total = 0;
		
		for(int i=0; i<100; i++) {
			total += analogRead(_pin);
			delay(1);
		}
		
		_temp_raw = total/100;
	} else
		_temp_raw = analogRead(_pin);

	return _temp_raw;
}


float Thermistor::getTempK(bool smooth=false) {
	_temp_raw = getTempRaw(smooth);

	_temp_k = log(((40960000/_temp_raw) - _resistor));
	_temp_k = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * _temp_k * _temp_k ))* _temp_k);
	
	return _temp_k;
}


float Thermistor::getTempC(bool smooth=false) {
	_temp_k = getTempK(smooth);
	
	_temp_c = _temp_k - 273.15;

	return _temp_c;
}


float Thermistor::getTempF(bool smooth=false) {
	_temp_c = getTempC(smooth);
	
	_temp_f = (_temp_c * 9.0)/ 5.0 + 32.0;

	return _temp_f;
}


float Thermistor::getTemp(bool smooth=false) {
	return getTempC(smooth);
}<commit_msg>remove default param from .cpp<commit_after>#include "thermistor-library.h"

Thermistor::Thermistor(int pin, int resistor) {
	_pin = pin;
	_resistor = resistor;
}


void Thermistor::begin(void) {
	pinMode(_pin, INPUT);
}


int Thermistor::getTempRaw(bool smooth=false) {
	delay(1);
	
	if(smooth==true) {
		int total = 0;
		
		for(int i=0; i<100; i++) {
			total += analogRead(_pin);
			delay(1);
		}
		
		_temp_raw = total/100;
	} else
		_temp_raw = analogRead(_pin);

	return _temp_raw;
}


float Thermistor::getTempK(bool smooth=false) {
	_temp_raw = getTempRaw(smooth);

	_temp_k = log(((40960000/_temp_raw) - _resistor));
	_temp_k = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * _temp_k * _temp_k ))* _temp_k);
	
	return _temp_k;
}


float Thermistor::getTempC(bool smooth) {
	_temp_k = getTempK(smooth);
	
	_temp_c = _temp_k - 273.15;

	return _temp_c;
}


float Thermistor::getTempF(bool smooth) {
	_temp_c = getTempC(smooth);
	
	_temp_f = (_temp_c * 9.0)/ 5.0 + 32.0;

	return _temp_f;
}


float Thermistor::getTemp(bool smooth) {
	return getTempC(smooth);
}
{'fraction_non_alphanumeric': 0.14825174825174825, 'fraction_numerical': 0.06060606060606061, 'mean_word_length': 4.259803921568627, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6622580', 'n_tokens_mistral': 1072, 'n_tokens_neox': 884, 'n_words': 166}