<commit_before>#include <Wire.h>

#define ARRAY_LENGTH(x)  (sizeof(x) / sizeof((x)[0]))

//#define LOG_SERIAL

//TODO 
//
// store read frequency in EEPROM
// write read frequency via I2C
// read frequency via I2C

const int sensorPins[][2] = {
  {
    A0,4          }
  ,{
    A1,3          }
  ,{
    A2,2          }
  ,{
    A3,1          }
};

const int sensor_SIZE = ARRAY_LENGTH(sensorPins);
unsigned int A_Values[sensor_SIZE];
unsigned long A_values_timestamp;

const int addressPins[] = {
  6,7,8,9};

void setup()
{  
  int i2cAddress = 0;
  for (int i=0;i<ARRAY_LENGTH(addressPins);i++){
    pinMode(addressPins[i], INPUT_PULLUP);

    if (digitalRead(addressPins[i]) == HIGH){
      i2cAddress += (1<<i);      
    }

    pinMode(addressPins[i], OUTPUT);
    digitalWrite(addressPins[i], LOW);
  }

  Wire.begin(i2cAddress);

  Wire.onReceive(receiveEvent);
  Wire.onRequest(requestEvent);

#ifdef LOG_SERIAL
  Serial.begin(9600);
#endif
}

void loop()
{
  for (int i=0;i<sensor_SIZE;i++){

    pinMode(sensorPins[i][0], INPUT_PULLUP);
    pinMode(sensorPins[i][1], OUTPUT);
    digitalWrite(sensorPins[i][1], LOW);<commit_msg>Add temp option for hardcoded adress<commit_after>#include <Wire.h>

#define ARRAY_LENGTH(x)  (sizeof(x) / sizeof((x)[0]))

//#define LOG_SERIAL
#define HARDCODEDADRESS 8
//TODO 
//
// store read frequency in EEPROM
// write read frequency via I2C
// read frequency via I2C

const int sensorPins[][2] = {
  {
    A0,4          }
  ,{
    A1,3          }
  ,{
    A2,2          }
  ,{
    A3,1          }
};

const int sensor_SIZE = ARRAY_LENGTH(sensorPins);
unsigned int A_Values[sensor_SIZE];
unsigned long A_values_timestamp;

const int addressPins[] = {
  6,7,8,9};

void setup()
{  
#ifndef HARDCODEDADRESS
  int i2cAddress = 0;
  for (int i=0;i<ARRAY_LENGTH(addressPins);i++){
    pinMode(addressPins[i], INPUT_PULLUP);

    if (digitalRead(addressPins[i]) == HIGH){
      i2cAddress += (1<<i);      
    }

    pinMode(addressPins[i], OUTPUT);
    digitalWrite(addressPins[i], LOW);
  }

  Wire.begin(i2cAddress);
#else
  Wire.begin(HARDCODEDADRESS);
#endif

  Wire.onReceive(receiveEvent);
  Wire.onRequest(requestEvent);

#ifdef LOG_SERIAL
  Serial.begin(9600);
#endif
}

void loop()
{
  for (int i=0;i<sensor_SIZE;i++){

    pinMode(sensorPins[i][0], INPUT_PULLUP);
    pinMode(sensorPins[i][1], OUTPUT);
    digitalWrite(sensorPins[i][1], LOW);
{'fraction_non_alphanumeric': 0.15468227424749165, 'fraction_numerical': 0.025501672240802676, 'mean_word_length': 3.3827838827838828, 'pattern_counts': {'":': 0, '<': 13, '<?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': '3073146', 'n_tokens_mistral': 975, 'n_tokens_neox': 942, 'n_words': 174}