asd
Dependencies: SDFileSystem mbed
Fork of SDFileSystem_HelloWorld by
SD card write - fat file system kl46z
Revision 3:b2658ae9fc38, committed 2017-08-24
- Comitter:
- fblanc92
- Date:
- Thu Aug 24 00:04:16 2017 +0000
- Parent:
- 2:8a7953dfeccd
- Child:
- 4:b77d7295fce4
- Commit message:
- Sin modif;
Changed in this revision
KL4Z_pinNames.h | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/KL4Z_pinNames.h Thu Aug 24 00:04:16 2017 +0000 @@ -0,0 +1,53 @@ +https://developer.mbed.org/teams/Freescale/wiki/frdm-kl46z-pinnames +detalles librerias: http://www.cplusplus.com/reference/cstdio/ + +LED (RG) +LED_RED = PTE29 +LED_GREEN = PTD5 + +mbed original LED naming +LED1 = LED_GREEN +LED2 = LED_RED +LED3 = LED_GREEN +LED4 = LED_RED + +Push buttons +SW1 = PTC3 +SW3 = PTC12 + +USB Pins +USBTX = PTA2 +USBRX = PTA1 + +Arduino Headers +D0 = PTA1 +D1 = PTA2 +D2 = PTD3 +D3 = PTA12 +D4 = PTA4 +D5 = PTA5 +D6 = PTC8 +D7 = PTC9 +D8 = PTA13 +D9 = PTD2 +D10 = PTD4 +D11 = PTD6 +D12 = PTD7 +D13 = PTD5 +D14 = PTE0 +D15 = PTE1 + +A0 = PTB0 +A1 = PTB1 +A2 = PTB2 +A3 = PTB3 +A4 = PTC2 +A5 = PTC1 + +I2C pins +I2C_SCL = D15 +I2C_SDA = D14 + +TSI electrodes +TSI_ELEC0 = PTB16 +TSI_ELEC1 = PTB17 \ No newline at end of file
--- a/main.cpp Wed Aug 23 17:21:15 2017 +0000 +++ b/main.cpp Thu Aug 24 00:04:16 2017 +0000 @@ -1,19 +1,17 @@ #include "mbed.h" #include "SDFileSystem.h" + SDFileSystem sd(PTA16,PTA17,PTA15,PTA14, "sd"); // the pinout on the mbed Cool Components workshop board -DigitalOut redLed(LED2); + int main() { - printf("Hello World!\n"); - mkdir("/sd/mydir", 0777); + mkdir("/sd/MiDirectorio", 0777); //creacion directorio - FILE *fp = fopen("/sd/mydir/sdtest.txt", "w"); - if(fp == NULL) { - error("Could not open file for write\n"); - } - fprintf(fp, "Hello fun SD Card World!"); - fclose(fp); - - printf("Goodbye World!\n"); - -} + FILE *fp = fopen("/sd/MiDirectorio/sdtest.txt", "w"); //puntero tipo file guarda directorio + /* if(fp == NULL) { + error("No se pudo abrir archivo para escritura\n"); + }; +*/ + fprintf(fp, "Hola Mundo - SD card - Blanc Federico, Kenedy Patricio, Scilabra Martin, Serafini Gerardo"); //file print + fclose(fp); //cierra archivo +} \ No newline at end of file