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
- Committer:
- INTRA\mitsuru.suzuki
- Date:
- 2018-03-28
- Revision:
- 9:35c816293400
- Parent:
- 5:614e3ac042df
File content as of revision 9:35c816293400:
#include "mbed.h"
#include "MMA7660.h"
#include "commands.h"
DigitalOut Zaxis_p(LED2);
DigitalOut Zaxis_n(LED3);
MMA7660 MMA(p28, p27);
static void _Initialize(void) {
Zaxis_p = 0;
Zaxis_n = 0;
}
static void _ProcessInitialize(void) {
}
static bool _ProcessIsContinue(void) {
return false;
}
static void _ProcessRunning(void) {
Zaxis_p = MMA.z();
Zaxis_n = -MMA.z();
}
static void _Finalize(void) {
_Initialize();
}
COMMAND_DEFINE Command_accel = {"accel", _Initialize, _Finalize,
_ProcessInitialize, _ProcessIsContinue, _ProcessRunning
};