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: Grove_3-Axis_Digital_Accelerometer_MMA7660FC_Library SeeedGrayOLED mbed-os
Fork of Seeed_Grove_3-Axis_Digital_Accelorometer_Example by
main.cpp
00001 00002 #include <mbed.h> 00003 #include "MMA7660.h" 00004 #include "SeeedGrayOLED.h" 00005 00006 MMA7660 accelemeter; 00007 00008 int main() 00009 { 00010 int8_t x, y, z; 00011 float ax,ay,az; 00012 accelemeter.init(); 00013 00014 while(1){ 00015 accelemeter.getXYZ(&x,&y,&z); 00016 printf("X=%d, Y=%d, Z=%d, ",x,y,z); 00017 00018 00019 00020 accelemeter.getAcceleration(&ax,&ay,&az); 00021 printf("Accleration of X=%2.2fg, Y=%2.2fg, Z=%2.2fg\n\r",ax,ay,az); 00022 wait(.5); 00023 } 00024 }
Generated on Tue Jul 12 2022 21:12:28 by
