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@4:d61f6d186db0, 2018-03-07 (annotated)
- Committer:
- ksaito
- Date:
- Wed Mar 07 10:57:16 2018 +0000
- Revision:
- 4:d61f6d186db0
- Parent:
- 1:2967eac08981
- Child:
- 5:614e3ac042df
???????????
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 | 1:2967eac08981 | 3 | #include "commands.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 | 4:d61f6d186db0 | 9 | static void _Initialize(void) { |
| ksaito | 0:c3bc6981ad28 | 10 | Zaxis_p = 0; |
| ksaito | 0:c3bc6981ad28 | 11 | Zaxis_n = 0; |
| ksaito | 0:c3bc6981ad28 | 12 | } |
| ksaito | 0:c3bc6981ad28 | 13 | |
| ksaito | 4:d61f6d186db0 | 14 | static void _Process(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 | 4:d61f6d186db0 | 19 | static void _Finalize(void) { |
| ksaito | 1:2967eac08981 | 20 | _Initialize(); |
| ksaito | 0:c3bc6981ad28 | 21 | } |
| ksaito | 1:2967eac08981 | 22 | |
| ksaito | 4:d61f6d186db0 | 23 | COMMAND_DEFINE Command_accel = {"accel", 0x02, _Initialize, _Finalize, _Process}; |