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
Diff: accel.cpp
- Revision:
- 1:2967eac08981
- Parent:
- 0:c3bc6981ad28
- Child:
- 4:d61f6d186db0
--- a/accel.cpp Wed Jan 31 10:58:19 2018 +0000
+++ b/accel.cpp Wed Feb 21 09:13:28 2018 +0000
@@ -1,21 +1,23 @@
#include "mbed.h"
#include "MMA7660.h"
-#include "accel.h"
+#include "commands.h"
DigitalOut Zaxis_p(LED2);
DigitalOut Zaxis_n(LED3);
MMA7660 MMA(p28, p27);
-void AccelInitialize(void) {
+void _Initialize(void) {
Zaxis_p = 0;
Zaxis_n = 0;
}
-void AccelProcess(void) {
+void _Process(void) {
Zaxis_p = MMA.z();
Zaxis_n = -MMA.z();
}
-void AccelFinalize(void) {
- AccelInitialize();
+void _Finalize(void) {
+ _Initialize();
}
+
+COMMAND_DEFINE Command_accel = {"accel", 0x02, _Initialize, _Finalize, _lProcess};