 SoftwareSerial mySerial(7, 8); // RX, TX
 #define RST  2
 
+// Tresholds for filtering out noise and non bikes
+#define UPPER_TRESHOLD 200.0
+#define LOWER_TRESHOLD -200.0
+
+// How long to ignore new spikes in bike detection after a successful count
+#define COUNTING_PAUSE_TIME 3000
+
+// Recording cycle running variables, will be reset whenever a message is full or time is up
+// Count of bikes in the current rexording cycle
+unsigned int bikeCount = 0;
+// Start time of the current recording cycle
+unsigned long cycleStartTime = 0;
+unsigned long cycleEndTime = 0;
+// duty time of a cycle
+long cycleDuration = 60000; // 1 minute (only for PoC, should be 10 minutes later)
 
 // README FIRST:
 // Rename or copy the File TTNCredentials.h.editme and remove the .editme ending.
 // Edit it it accordingly and put your TTN keys in there, make sure you add it to git ignores.
 // Here we load it to be used, this file is kept out of GIT as its the private parts
 #include "TTNCredentials.h"
+
+// Debugging options
+#define debug FALSE
 
 rn2xx3 myLora(mySerial);
 


  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  mySerial.begin(9600);
  Serial.println("Startup");

  // Reset rn2483
  pinMode(RST, OUTPUT);
  digitalWrite(RST, HIGH);

    join_result = myLora.init();
  }
  Serial.println("Successfully joined TTN");
}

void readPressure() {
  difPressure = SDP6x.GetPressureDiff();
