+#include <Encoder.h>
 #include <Queue.h>
+
+#define POS_1 888
+#define POS_2 931
+#define POS_3 971
+int current_pos = 0;
 
 Queue sendQueue;
 int n;
+
+Encoder baro(18, 19);
     
 void setup() {
   Serial.begin(9600);

    
    message.getBytes(buffer, 64);
    RawHID.send(buffer, 100);
  }
}

int sendData(unsigned long now)

unsigned int packetCount = 0;

void loop() {
  delay(50);
  
  //Serial.println(baro.read());
  
  Serial.print(analogRead(18));
  //Serial.print(" ");
  //Serial.println(analogRead(19));
  
  int s1 = analogRead(14);
  if (s1 <= POS_1 + 10 && s1 >= POS_1 - 10)
    if (current_pos != 1) {
      current_pos = 1;
      Serial.println("pos1");
    }
  if (s1 <= POS_2 + 10 && s1 >= POS_2 - 10)
    if (current_pos != 2) {
      current_pos = 2;
      Serial.println("pos2");
    }
  if (s1 <= POS_3 + 10 && s1 >= POS_3 - 10)
    if (current_pos != 3) {
      current_pos = 3;
      Serial.println("pos3");
    }
  
  //Serial.println(analogRead(14));
  
  sendQueue.Run(millis());
  
  n = RawHID.recv(receiveBuffer, 1); // 0 timeout = do not wait
