unsigned long codeTime = 0; //The time the sketch takes to execute
static unsigned long char uint16_tdataArray dataArray[1];[1]; // a variable to hold both sensor data
void setup(){
Serial.begin(9600);
Serial1.begin(9600);
}
void state1(){
if (Serial1.available()){
while (Serial1.available() > 0){
codeTime = millis(); //using the millis() instead of micros()
dataArray[0]//memcpy =should codeTime;copy the whole data into position 0 ????
intmemcpy(&dataArray[0], newByte&codeTime,sizeof(codeTime));
uint16_t newByte1 = Serial1.read(); // read in the first byte
uint16_t newByte2 = Serial1.read(); //read in the second byte
uint16_t dataByte = newByte2 >> 8;
dataByte = (dataByte | newByte1);
dataArray[1] = newByte;dataByte;
Serial1.write((uint16_t*)dataArray, sizeOf(dataArray));
}
}
}
void loop(){
state1();
Serial1.flush(); //clear the serial port
delay(100);
}