<commit_before>#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>

#include "HX711.h"

/////////////////////
// Pin Definitions //
/////////////////////
const int LED_PIN = 5; // Thing's onboard, green LED
const int LOADCELL_DATA = 12;
const int LOADCELL_CLK = 13;

ESP8266WebServer server(80);
HX711 scale(LOADCELL_DATA, LOADCELL_CLK);
float calibration_factor = 2000; // needs to come from calibration sketch

void setupScale() {
  scale.set_scale();
  scale.tare();  //Reset the scale to 0
  scale.set_scale(calibration_factor); //Adjust to this calibration factor
}

float getScaleWeight(){
  return scale.get_units(5);  // average of 5 readings
}

const char pageFirstPart[]="<html>\
  <head>\
    <title>447 Project</title>\
  </head>\
  <body>\
";

const char pageEnding[]="</body>\
</html>";


void handleRoot()
{<commit_msg>Removed redundant setscale and changed to 3 readings instead of 5<commit_after>#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>

#include "HX711.h"

/////////////////////
// Pin Definitions //
/////////////////////
const int LED_PIN = 5; // Thing's onboard, green LED
const int LOADCELL_DATA = 12;
const int LOADCELL_CLK = 13;

ESP8266WebServer server(80);
HX711 scale(LOADCELL_DATA, LOADCELL_CLK);
float calibration_factor = 2000; // needs to come from calibration sketch

void setupScale() {
  scale.tare();  //Reset the scale to 0
  scale.set_scale(calibration_factor); //Adjust to this calibration factor
}

float getScaleWeight(){
  return scale.get_units(3);  // average of 3 readings
}

const char pageFirstPart[]="<html>\
  <head>\
    <title>447 Project</title>\
  </head>\
  <body>\
";

const char pageEnding[]="</body>\
</html>";


void handleRoot()
{
{'fraction_non_alphanumeric': 0.17712609970674487, 'fraction_numerical': 0.04222873900293255, 'mean_word_length': 3.363171355498721, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '3057262', 'n_tokens_mistral': 636, 'n_tokens_neox': 560, 'n_words': 159}