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 "MSS.h" 00003 #include "MMA8452Q.h" 00004 00005 #define MMA8452_I2C_ADDRESS (0x1d) 00006 00007 int main(void) { 00008 float x, y, z ; 00009 00010 MMA8452Q acc(PIN_SDA, PIN_SCL, MMA8452_I2C_ADDRESS); 00011 00012 printf("=== test MMA8452Q for %s (%s) ===\n",BOARD_NAME, __DATE__) ; 00013 printf(" X, Y, Z\n") ; 00014 00015 while (true) { 00016 x = acc.getAccX() ; 00017 y = acc.getAccY() ; 00018 z = acc.getAccZ() ; 00019 printf("%.2f, %.2f, %.2f\n",x, y, z) ; 00020 wait(0.1); 00021 } 00022 } 00023
Generated on Thu Jul 14 2022 03:56:24 by
1.7.2