Take orientation into account when reporting accelerometer sensor readout
clean up coding style and remove explicit temporary variable
Merge pull request #3401 from folecr/accel

Take orientation into account when reporting accelerometer sensor readout