<commit_before>/*
  DS18B20.h - Library for reading the voltage of a battery or solarcell.
  See sensV for circuitry.
  Created by Maurice (Mausy5043) Hendrix, FEB2015

  MIT license
*/

#include "DS18B20.h"

DS18B20::DS18B20(int pin, int samples)
{
  _pin = pin;
  _samples = samples;
}

void DS18B20::begin(void)
{
  // set up the pin!
  OneWire _1wire(_pin);
  _invsamples =  1.0/(float)_samples;
  if ( !ds.search(_addr))
  {
    Serial.println("No sensor.");
  }
}

float DS18B20::readTemperature(void)
{
  int cntSamples = 0;
  int sumSamples = 0;
  float measurement = 0.0;

  // add up the pre-defined number of _samples for Sample Averaging
  for (cntSamples = 0; cntSamples < _samples; cntSamples++)
  {
    //sumSamples += analogRead(_pin);
    // minimum delay on analog pins is 100ms
    delay(110);
  }
  //measurement = (float)sumSamples * _invsamples; // Calculate avg raw value.
  //measurement = map(measurement * 10, 0, 10230, 0, _ref5v * 10000) * 0.0001;
  //measurement *= _r12;
  //return measurement;
  return -0.001;
}
<commit_msg>20150217.1457<commit_after>/*
  DS18B20.h - Library for reading the voltage of a battery or solarcell.
  See sensV for circuitry.
  Created by Maurice (Mausy5043) Hendrix, FEB2015

  MIT license
*/

#include "DS18B20.h"

DS18B20::DS18B20(int pin, int samples)
{
  _pin = pin;
  _samples = samples;
}

void DS18B20::begin(void)
{
  // set up the pin!
  OneWire _1wire(_pin);
  _invsamples =  1.0/(float)_samples;
  if ( !_1wire.search(_addr))
  {
    Serial.println("No sensor.");
  }
}

float DS18B20::readTemperature(void)
{
  int cntSamples = 0;
  int sumSamples = 0;
  float measurement = 0.0;

  // add up the pre-defined number of _samples for Sample Averaging
  for (cntSamples = 0; cntSamples < _samples; cntSamples++)
  {
    //sumSamples += analogRead(_pin);
    // minimum delay on analog pins is 100ms
    delay(110);
  }
  //measurement = (float)sumSamples * _invsamples; // Calculate avg raw value.
  //measurement = map(measurement * 10, 0, 10230, 0, _ref5v * 10000) * 0.0001;
  //measurement *= _r12;
  //return measurement;
  return -0.001;
}

{'fraction_non_alphanumeric': 0.1281929990539262, 'fraction_numerical': 0.07426679280983917, 'mean_word_length': 3.2641129032258065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1195363', 'n_tokens_mistral': 889, 'n_tokens_neox': 771, 'n_words': 214}