Implemented a gyroscope as well. 
Data is written to trace1-data-acc.csv and trace1-data-gyro.csv
respectively.