+unsigned char ide_workaround = 0;
+
 #include <SoftwareSerial.h>
 
 #define SET_PIN 12
 #define SENSOR_BAUD_RATE 9600
 #define DEBUG_BARUD_RATE 115200
 
+#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+#define mySerial Serial3
+#define DebugSerial Serial
+#else
 #define _DBG_RXPIN_ 2
 #define _DBG_TXPIN_ 3
-
-#define SOFTSERIAL
-
-#ifdef SOFTSERIAL
 SoftwareSerial mySerial(_DBG_RXPIN_,_DBG_TXPIN_);
 #define DebugSerial	Serial
-#else
-#define mySerial Serial
-SoftwareSerial DebugSerial(_DBG_RXPIN_,_DBG_TXPIN_);
 #endif
+
 
 boolean findHeader()
 {

void setup() {
    mySerial.begin(SENSOR_BAUD_RATE);     // opens serial port, sets data rate to 9600 bps
    DebugSerial.begin(DEBUG_BARUD_RATE);
    pinMode(SET_PIN, OUTPUT);
    digitalWrite(SET_PIN, LOW); 
    delay(100);

void loop() {
    static unsigned int data[15]={0};
    int i;
    
    DebugSerial.println("reading..");
    while (!( mySerial.available() > 0 && findHeader() )) { };
    
    //DebugSerial.println(mySerial.available());
