<commit_before>/*
Reads the values from a0-a3 and writes them as binary to the serial interface.

MIT LICENSE 2016
*/

#define N 128

typedef struct {
	unsigned long time; // 32bit
	int a0; // 16bit
	int a1;
	int a2;
} __attribute__((__packed__)) Data;

Data MESSAGES[N];
size_t counter = 0;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication
  Serial.begin(115200); // bits per second
}

// the loop routine runs over and over again forever:
void loop() {
  
  // read the input on analog pin 0:
  unsigned long time = micros(); // time since program start.
                                 // Overflows after 40 minutes

  // It takes about 100 microseconds (0.0001 s) to read an analog input,
  // so the maximum reading rate is about 10,000 times a second.
  int a0 = analogRead(A0);
  int a1 = analogRead(A1);
  int a2 = analogRead(A2);
  
  // create msg
  Data msg = {time, a0, a1, a2};
  
  if (counter < N) {
	  MESSAGES[counter] = msg;
	  counter++;
  }
  
  // send data over serial
  if (counter == N) {
	  counter = 0;
	  Serial.write("SSSSSSSSSS"); // Start tag 32bit zeros
	  Serial.write((uint8_t*) MESSAGES, N*sizeof(*MESSAGES));
  }
}
<commit_msg>space out analog reads<commit_after>/*
Reads the values from a0-a3 and writes them as binary to the serial interface.

MIT LICENSE 2016
*/

#define N 128

typedef struct {
	unsigned long time; // 32bit
	int a0; // 16bit
	int a1;
	int a2;
} __attribute__((__packed__)) Data;

Data MESSAGES[N];
size_t counter = 0;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication
  Serial.begin(115200); // bits per second
}

// the loop routine runs over and over again forever:
void loop() {
  
  // read the input on analog pin 0:
  unsigned long time = micros(); // time since program start.
                                 // Overflows after 40 minutes

  // It takes about 100 microseconds (0.0001 s) to read an analog input,
  // so the maximum reading rate is about 10,000 times a second.
  int a0 = analogRead(A0);
  int a2 = analogRead(A2);
  int a4 = analogRead(A4);
  
  // create msg
  Data msg = {time, a0, a2, a4};
  
  if (counter < N) {
	  MESSAGES[counter] = msg;
	  counter++;
  }
  
  // send data over serial
  if (counter == N) {
	  counter = 0;
	  Serial.write("SSSSSSSSSS"); // Start tag 32bit zeros
	  Serial.write((uint8_t*) MESSAGES, N*sizeof(*MESSAGES));
  }
}

{'fraction_non_alphanumeric': 0.11188240097999183, 'fraction_numerical': 0.04246631278072683, 'mean_word_length': 2.712121212121212, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2520460', 'n_tokens_mistral': 892, 'n_tokens_neox': 799, 'n_words': 307}