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:
- 0:c3bc6981ad28
- Child:
- 1:2967eac08981
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/accel.cpp Wed Jan 31 10:58:19 2018 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include "MMA7660.h"
+#include "accel.h"
+
+DigitalOut Zaxis_p(LED2);
+DigitalOut Zaxis_n(LED3);
+MMA7660 MMA(p28, p27);
+
+void AccelInitialize(void) {
+ Zaxis_p = 0;
+ Zaxis_n = 0;
+}
+
+void AccelProcess(void) {
+ Zaxis_p = MMA.z();
+ Zaxis_n = -MMA.z();
+}
+
+void AccelFinalize(void) {
+ AccelInitialize();
+}