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: mbed C12832 MMA7660
testpremier.cpp
- Committer:
- Ambroisie
- Date:
- 2018-12-17
- Revision:
- 0:c8f6fd3a3e6a
File content as of revision 0:c8f6fd3a3e6a:
#include "mbed.h"
#include "MMA7660.h"
#include "C12832.h"
MMA7660 MMA(p28, p27);
C12832 lcd(p5, p7, p6, p8, p11);
DigitalOut connectionLed(LED1);
int main() {
if (MMA.testConnection())
connectionLed = 1;
lcd.cls();
while(1) {
lcd.locate(0,0);
lcd.printf("AccelX: %4.2f",MMA.x());
lcd.locate(0,8);
lcd.printf("AccelY: %4.2f",MMA.y());
lcd.locate(0,16);
lcd.printf("AccelZ: %4.2f",MMA.z());
wait(0.5);
}
}