<commit_before>#include <JeeLib.h>
#include <RCSwitch.h> // https://code.google.com/p/rc-switch/
#include <PinChangeInt.h>

RCSwitch rf = RCSwitch();
ISR(WDT_vect) {Sleepy::watchdogEvent();}  // Setup for low power waiting

int calibrationTime = 10;        //the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int rfPacketsToSend = 10; 

// Pins
int PIR = 2;
int LED = 13;
int RFTX = 9;   
int RFPOWER = 8;// do tranzystora

int rfAlertCode = 666; // code send when motion detected

void setup() {
  Serial.begin(9600);
  pinMode(PIR, INPUT);
  pinMode(LED, OUTPUT);
  pinMode(RFPOWER, OUTPUT);
  rf.enableTransmit(RFTX);

  PRR = bit(PRTIM1);                           // only keep timer 0 going
  ADCSRA &= ~ bit(ADEN); bitSet(PRR, PRADC);   // Disable the ADC to save power
  PCintPort::attachInterrupt(PIR, wakeUp, CHANGE);
  
  CalibratePirSensor();  //give the sensor some time to calibrate
}

void loop() {
  int ll = HIGH;
  digitalWrite(RFPOWER, HIGH);// wlacz zasilanie w rf
  delay(100);
  Serial.println("Motion detected");
  for (int i = 0; i < rfPacketsToSend; i++)
  {
    Serial.print(".");
    rf.send(rfAlertCode, 24);
    digitalWrite(LED, ll);
    ll = ll == HIGH ? LOW : HIGH;
  }
  digitalWrite(RFPOWER, LOW); // wylacz rf
  Serial.println("");
  
  Sleepy::powerDown();
}

void wakeUp() {}

void CalibratePirSensor()
{
  int ll = HIGH;
  Serial.println("Calibrating PIR sensor ");
  for (int i = 0; i < calibrationTime; i++) {
    Serial.print(".");
    delay(1000);
    digitalWrite(LED, ll);
    ll = ll == HIGH ? LOW : HIGH;
  }
  Serial.println("");
  Serial.println("Sensor active");
  digitalWrite(LED, LOW);
  delay(50);
}
<commit_msg>Now sensor sends id and value eg: 1100123 where 11 is id and 123 is value<commit_after>#include <JeeLib.h>
#include <RCSwitch.h> // https://code.google.com/p/rc-switch/
#include <PinChangeInt.h>

long sensorId = 11;         // sensor identifier - from 1 to 99
long sensorAlertCode = 1;  // value send by sensor from 1 to 99999

int rfAlertCode = 1;     // must be in 24 bit so max 16777215 , should containd sensor id sensor value 
int calibrationTime = 12;  //the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int rfPacketsToSend = 7;   // to be sure message is received I send messge few times

// Pins
int PIR = 2;
int LED = 13;
int RFTX = 9;   
int RFPOWER = 8;// do tranzystora

RCSwitch rf = RCSwitch();
ISR(WDT_vect) {Sleepy::watchdogEvent();}  // Setup for low power waiting

void setup() {
  Serial.begin(9600);
  pinMode(PIR, INPUT);
  pinMode(LED, OUTPUT);
  pinMode(RFPOWER, OUTPUT);
  rf.enableTransmit(RFTX);

  PRR = bit(PRTIM1);                           // only keep timer 0 going
  ADCSRA &= ~ bit(ADEN); bitSet(PRR, PRADC);   // Disable the ADC to save power
  PCintPort::attachInterrupt(PIR, wakeUp, CHANGE);
  
  CalibratePirSensor();  //give the sensor some time to calibrate
}

void loop() {
  Serial.print("<"); // Motion detected
  digitalWrite(LED, HIGH);
  digitalWrite(RFPOWER, HIGH);// wlacz zasilanie w rf
  delay(100);
  digitalWrite(LED, LOW);
  
  for (int i = 0; i < rfPacketsToSend; i++)
  {
    rf.send((sensorId * 100000) + sensorAlertCode, 24); // it will send 11 00001 where 11 is sensor id and 1 is motion detected
    Serial.print(".");
  }
  digitalWrite(RFPOWER, LOW); // wylacz zasialnie rf
  Serial.println(">");
  delay(100);
  Sleepy::powerDown();
}

void wakeUp() { }

void CalibratePirSensor()
{
  
  Serial.println("Calibrating PIR sensor ");
  for (int i = 0; i < calibrationTime; i++) {
    Serial.print(".");
    digitalWrite(LED, HIGH);
    delay(100);
    digitalWrite(LED, LOW);
    delay(900);
  }
  Serial.println("");
  Serial.println("Sensor active");
  digitalWrite(LED, LOW);
  delay(50);
}
{'fraction_non_alphanumeric': 0.1405505558496559, 'fraction_numerical': 0.03229221810481736, 'mean_word_length': 3.2700564971751414, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 10, 'https://': 2, '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': '810912', 'n_tokens_mistral': 1482, 'n_tokens_neox': 1375, 'n_words': 398}