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
main.cpp
00001 //mbed library 00002 #include "mbed.h" 00003 //lcd library 00004 #include "C12832.h" 00005 //accelerometer library 00006 #include "MMA7660.h" 00007 00008 //init LCD 00009 C12832 lcd(p5, p7, p6, p8, p11); 00010 // init accel 00011 MMA7660 MMA(p28, p27); 00012 00013 int main() 00014 { 00015 lcd.cls(); 00016 lcd.locate(0,3); 00017 lcd.printf("mbed application board!"); 00018 wait(5); 00019 if (MMA.testConnection()) { 00020 lcd.printf("the accelerometer is working OK"); 00021 wait(5); 00022 } 00023 while(true) { 00024 lcd.locate(0,3); 00025 lcd.printf(" X Y Z \n"); 00026 lcd.locate(0,15); 00027 lcd.printf("%.3f %.3f %.3f \r", MMA.x(), MMA.y(), MMA.z()); 00028 wait(1); 00029 lcd.cls(); 00030 } 00031 } 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063
Generated on Fri Jul 22 2022 16:09:56 by
1.7.2