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:
- ksaito
- Date:
- 2018-03-07
- Revision:
- 4:d61f6d186db0
- Parent:
- 1:2967eac08981
- Child:
- 5:614e3ac042df
File content as of revision 4:d61f6d186db0:
#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 _Process(void) {
Zaxis_p = MMA.z();
Zaxis_n = -MMA.z();
}
static void _Finalize(void) {
_Initialize();
}
COMMAND_DEFINE Command_accel = {"accel", 0x02, _Initialize, _Finalize, _Process};