Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed DCM_AHRS_GY80 PID MMA8451Q
Fork of quadCommand by
quadCommand/sensorS/sensors.cpp@0:8681037b9a18, 2013-06-09 (annotated)
- Committer:
- gabdo
- Date:
- Sun Jun 09 22:13:59 2013 +0000
- Revision:
- 0:8681037b9a18
- Child:
- 1:9b90e7de6e09
quadCommand!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gabdo | 0:8681037b9a18 | 1 | /************************ quadCommand.cpp ********************************/ |
gabdo | 0:8681037b9a18 | 2 | /* */ |
gabdo | 0:8681037b9a18 | 3 | /*************************************************************************/ |
gabdo | 0:8681037b9a18 | 4 | |
gabdo | 0:8681037b9a18 | 5 | #include "sensors.h" |
gabdo | 0:8681037b9a18 | 6 | |
gabdo | 0:8681037b9a18 | 7 | sensors::sensors() |
gabdo | 0:8681037b9a18 | 8 | { |
gabdo | 0:8681037b9a18 | 9 | acc = new MMA8451Q( ACCSDA, ACCSCL, MMA8451_I2C_ADDRESS); |
gabdo | 0:8681037b9a18 | 10 | } |
gabdo | 0:8681037b9a18 | 11 | |
gabdo | 0:8681037b9a18 | 12 | short sensors::getAbsoluteX() |
gabdo | 0:8681037b9a18 | 13 | { |
gabdo | 0:8681037b9a18 | 14 | return (short)(acc->getAccX() * 100); |
gabdo | 0:8681037b9a18 | 15 | } |
gabdo | 0:8681037b9a18 | 16 | |
gabdo | 0:8681037b9a18 | 17 | short sensors::getAbsoluteY() |
gabdo | 0:8681037b9a18 | 18 | { |
gabdo | 0:8681037b9a18 | 19 | return (short)(acc->getAccY() * 100); |
gabdo | 0:8681037b9a18 | 20 | } |