<commit_before>/*
  glass.ino

  This code is running on the glass, taking control of IR tranmission, XBee communication, and BT communication.

  XBee messages from client are routed to Google Glass for display purpose.
  BT messages from Google Glass either trigger IR transmission, or are being delivered to clients. As before, we are using XBee broadcast mechanism.

  Now we've switched to Arduino Mega, no need for software serial. For old code, using git log to find it... 

  Created 07/17/2013
  Modified 07/25/2013
  By <EMAIL>

*/

#include <IRremote.h>


#define DEBUG

#ifdef DEBUG
  #define DEBUG_PRINT(x)  Serial.print(x)
  #define DEBUG_PRINTLN(x)  Serial.println(x)
  #define DEBUG_TAGGING(x, y)  Serial.print(x); Serial.println(y)
#else
  #define DEBUG_PRINT(x)
  #define DEBUG_PRINTLN(x)
#endif


#define BT Serial1
#define XBee Serial2



// An IR LED must be connected to Arduino PWM pin 3.
IRsend irsend;
int ledPin = 8;

char message[50];

unsigned long start_time;
boolean isWaitingReply;
char XBeeReturnIDs[20];
int XBeeReturnCount;
boolean ir_bcast_mode = true;
unsigned long ir_time;
unsigned int ir_cycle = 200;  // broadcat IR signal every X ms
unsigned int ir_response_threshold = 600;

// EXPERIMENT
const int MODE_IR = 1;
const int MODE_LIST = 2;
int exp_mode = MODE_IR;

void setup()
{
  Serial.begin(9600);
  randomSeed(analogRead(5));
  digitalWrite(ledPin, LOW);
  XBee.begin(9600);
  BT.begin(57600);
  isWaitingReply = false;
  delay(100);

  Serial.print("system begins!");
  ir_time = millis();

}

void loop() {
  if (isWaitingReply) {
    if (XBee.available()) {
      if (XBeeReturnCount >= 1) {
        XBeeReturnIDs[XBeeReturnCount*3-1] = ':';<commit_msg>increase IR return threshold<commit_after>/*
  glass.ino

  This code is running on the glass, taking control of IR tranmission, XBee communication, and BT communication.

  XBee messages from client are routed to Google Glass for display purpose.
  BT messages from Google Glass either trigger IR transmission, or are being delivered to clients. As before, we are using XBee broadcast mechanism.

  Now we've switched to Arduino Mega, no need for software serial. For old code, using git log to find it... 

  Created 07/17/2013
  Modified 07/25/2013
  By <EMAIL>

*/

#include <IRremote.h>


#define DEBUG

#ifdef DEBUG
  #define DEBUG_PRINT(x)  Serial.print(x)
  #define DEBUG_PRINTLN(x)  Serial.println(x)
  #define DEBUG_TAGGING(x, y)  Serial.print(x); Serial.println(y)
#else
  #define DEBUG_PRINT(x)
  #define DEBUG_PRINTLN(x)
#endif


#define BT Serial1
#define XBee Serial2



// An IR LED must be connected to Arduino PWM pin 3.
IRsend irsend;
int ledPin = 8;

char message[50];

unsigned long start_time;
boolean isWaitingReply;
char XBeeReturnIDs[20];
int XBeeReturnCount;
boolean ir_bcast_mode = true;
unsigned long ir_time;
unsigned int ir_cycle = 200;  // broadcat IR signal every X ms
unsigned int ir_response_threshold = 800;

// EXPERIMENT
const int MODE_IR = 1;
const int MODE_LIST = 2;
int exp_mode = MODE_IR;

void setup()
{
  Serial.begin(9600);
  randomSeed(analogRead(5));
  digitalWrite(ledPin, LOW);
  XBee.begin(9600);
  BT.begin(57600);
  isWaitingReply = false;
  delay(100);

  Serial.print("system begins!");
  ir_time = millis();

}

void loop() {
  if (isWaitingReply) {
    if (XBee.available()) {
      if (XBeeReturnCount >= 1) {
        XBeeReturnIDs[XBeeReturnCount*3-1] = ':';
{'fraction_non_alphanumeric': 0.09838945827232796, 'fraction_numerical': 0.030453879941434846, 'mean_word_length': 4.038348082595871, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '603917', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1158, 'n_words': 389}