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: MMA8451Q SDFileSystem mbed
Fork of SDCardTest by
main.cpp
00001 #include "mbed.h" 00002 #include "SDFileSystem.h" 00003 #include "MMA8451Q.h" 00004 00005 SDFileSystem sd(PTD2, PTD3, PTD1, PTD0, "sd"); 00006 MMA8451Q acc(PTE25,PTE24); 00007 00008 00009 00010 int main() { 00011 int16_t data[3]; 00012 00013 FILE *fp = fopen("/sd/sdtest.txt", "w"); 00014 if(fp == NULL) { 00015 error("Could not open file for write\n"); 00016 } 00017 while(1) 00018 { 00019 acc.getAccAllAxis(data); 00020 fprintf(fp, "%d",data[0]); 00021 fprintf(fp, ", %d",data[1]); 00022 fprintf(fp, ", %d\n",data[2]); 00023 /* if() 00024 { 00025 break; 00026 }*/ 00027 } 00028 fclose(fp); 00029 printf("Goodbye World!\n"); 00030 }
Generated on Tue Jul 12 2022 20:46:00 by
1.7.2
