title: node red function and export to CSV
body: <p>I have the raspberry pi and sense hat.  I wish to extract acceleration z,y,x,Temperature and Pressure and time to csv.  However, the code I've written does not do what i want it to do.  I was expecting the data to leave the function in an array but the debug window shows them as separate objects.  How do i get acceleration z,y,x and time to leave as one array so i can export to CSV? </p>
  
  <pre><code>    29/03/2017, 17:17:23node: abf1ef08.31a6f
  msg : Object
  object
  payload: 0.9487
  _msgid: "ae0db049.020f6"
  29/03/2017, 17:17:23node: abf1ef08.31a6f
  msg : Object
  object
  payload: 0.2781
  _msgid: "ae0db049.020f6"
  29/03/2017, 17:17:23node: abf1ef08.31a6f
  msg : Object
  object
  payload: 0.1491
  _msgid: "ae0db049.020f6"
  29/03/2017, 17:17:23node: abf1ef08.31a6f
  msg : Date
  "Wed Mar 29 2017 16:17:25 GMT+0000 (UTC)
  </code></pre>
  
  <p>Here's the function code :</p>
  
  <pre><code>var msgAccelZ,msgAccelX,msgAccelY,msgTemperature,msgPressure,msgCurrentTime;
  if (msg.topic === 'motion') {
      msgAccelZ = { payload: msg.payload.acceleration.z, };
      msgAccelX = { payload: msg.payload.acceleration.x, };
      msgAccelY = { payload: msg.payload.acceleration.y, };
  } else if (msg.topic === 'environment') {
      msgTemperature = { payload: msg.payload.temperature };
      msgPressure = { payload: msg.payload.pressure };
  }
  msgCurrentTime = new Date();
  return [ [msgAccelZ, msgAccelX, msgAccelY,msgCurrentTime] ,[msgTemperature, msgPressure, msgCurrentTime] ];
  </code></pre>