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: C12832 MMA7660 mbed
accel.cpp@0:c3bc6981ad28, 2018-01-31 (annotated)
- Committer:
- ksaito
- Date:
- Wed Jan 31 10:58:19 2018 +0000
- Revision:
- 0:c3bc6981ad28
- Child:
- 1:2967eac08981
???????
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ksaito | 0:c3bc6981ad28 | 1 | #include "mbed.h" |
| ksaito | 0:c3bc6981ad28 | 2 | #include "MMA7660.h" |
| ksaito | 0:c3bc6981ad28 | 3 | #include "accel.h" |
| ksaito | 0:c3bc6981ad28 | 4 | |
| ksaito | 0:c3bc6981ad28 | 5 | DigitalOut Zaxis_p(LED2); |
| ksaito | 0:c3bc6981ad28 | 6 | DigitalOut Zaxis_n(LED3); |
| ksaito | 0:c3bc6981ad28 | 7 | MMA7660 MMA(p28, p27); |
| ksaito | 0:c3bc6981ad28 | 8 | |
| ksaito | 0:c3bc6981ad28 | 9 | void AccelInitialize(void) { |
| ksaito | 0:c3bc6981ad28 | 10 | Zaxis_p = 0; |
| ksaito | 0:c3bc6981ad28 | 11 | Zaxis_n = 0; |
| ksaito | 0:c3bc6981ad28 | 12 | } |
| ksaito | 0:c3bc6981ad28 | 13 | |
| ksaito | 0:c3bc6981ad28 | 14 | void AccelProcess(void) { |
| ksaito | 0:c3bc6981ad28 | 15 | Zaxis_p = MMA.z(); |
| ksaito | 0:c3bc6981ad28 | 16 | Zaxis_n = -MMA.z(); |
| ksaito | 0:c3bc6981ad28 | 17 | } |
| ksaito | 0:c3bc6981ad28 | 18 | |
| ksaito | 0:c3bc6981ad28 | 19 | void AccelFinalize(void) { |
| ksaito | 0:c3bc6981ad28 | 20 | AccelInitialize(); |
| ksaito | 0:c3bc6981ad28 | 21 | } |