private void DumpAccelData() { short x = 0; _dataArray[0 + _offset] = RTC.Hours(); _dataArray[1 + _offset] = RTC.Minutes(); _dataArray[2 + _offset] = RTC.Seconds(); for (var i = 0; i < _arraySize; i += 2) { short raw = 0; switch (x++ % 3) { case 0: raw = (short)(XPin.Read() * 1000); break; case 2: raw = (short)(YPin.Read() * 1000); break; case 1: raw = (short)(ZPin.Read() * 1000); break; } _dataArray[i + _offset + 3] = (byte)(raw & 0xFF); _dataArray[i + +_offset + 4] = (byte)((raw >> 8) & 0xFF); //var period = 1000*(1/_frequency); //if (period < 1) period = 1; //Thread.Sleep(period); } var time = RTC.CurrentTime(); _dataArray[_arraySize + _offset + 3] = time[0]; //hours _dataArray[_arraySize + _offset + 4] = time[1]; //minutes _dataArray[_arraySize + _offset + 5] = time[2]; //seconds Debug.Print("Accel data dump complete - free mem: " + Debug.GC(true)); }