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.
main.cpp
00001 #include "mbed.h" 00002 #include "MMA8451Q.h" 00003 #include "MSS.h" 00004 00005 MMA8451Q *acc = 0 ; 00006 00007 int main() { 00008 float fx, fy, fz ; 00009 00010 #if 0 // for FRDM-KL25Z ONBOARDSENSOR 00011 acc = new MMA8451Q(PTE25, PTE24, 0x1D) ; 00012 #endif 00013 #if 1 // for MSU MMA8451Q on MSS 00014 acc = new MMA8451Q(PIN_SDA, PIN_SCL, 0x1C) ; 00015 #endif 00016 00017 printf("=== test MMA8451Q for %s (%s) ===\n", BOARD_NAME, __DATE__) ; 00018 printf(" X, Y, Z\n") ; 00019 00020 while(1) { 00021 fx = acc->getAccX() ; 00022 fy = acc->getAccY() ; 00023 fz = acc->getAccZ() ; 00024 printf("%.2f, %.2f, %.2f\n", fx, fy, fz ) ; 00025 wait(0.2) ; 00026 } 00027 }
Generated on Tue Jul 12 2022 16:12:42 by
