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.
main.cpp@1:a531b03fca97, 2015-12-30 (annotated)
- Committer:
- MACRUM
- Date:
- Wed Dec 30 16:18:11 2015 +0000
- Revision:
- 1:a531b03fca97
- Parent:
- 0:b5c7d79e5d7c
- Child:
- 2:b958ed2f998d
library updated
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| MACRUM | 0:b5c7d79e5d7c | 1 | |
| MACRUM | 0:b5c7d79e5d7c | 2 | #include "mbed.h" |
| MACRUM | 0:b5c7d79e5d7c | 3 | #include "KX022.h" |
| MACRUM | 0:b5c7d79e5d7c | 4 | |
| MACRUM | 0:b5c7d79e5d7c | 5 | Serial pc(USBTX, USBRX); |
| MACRUM | 0:b5c7d79e5d7c | 6 | KX022 acc(I2C_SDA, I2C_SCL); |
| MACRUM | 0:b5c7d79e5d7c | 7 | |
| MACRUM | 0:b5c7d79e5d7c | 8 | int main() { |
| MACRUM | 0:b5c7d79e5d7c | 9 | pc.printf("\nKX022 Accelerometer library test program.\n"); |
| MACRUM | 0:b5c7d79e5d7c | 10 | |
| MACRUM | 0:b5c7d79e5d7c | 11 | while(1) { |
| MACRUM | 0:b5c7d79e5d7c | 12 | wait(0.5); |
| MACRUM | 0:b5c7d79e5d7c | 13 | pc.printf("x=%7.4f, y=%7.4f, z=%7.4f\n", acc.getAccX(), acc.getAccY(), acc.getAccZ()); |
| MACRUM | 0:b5c7d79e5d7c | 14 | } |
| MACRUM | 0:b5c7d79e5d7c | 15 | } |
Rohm/Kionix KX022-1020 | Accelerometer