cauqleuir madre

Dependencies:   SDFileSystem mbed TFTLCD

Committer:
Danton
Date:
Fri Feb 01 23:13:20 2013 +0000
Revision:
10:fe0ef95e853e
Parent:
9:53afaa0431af
Child:
11:5b7063d581fa
sd pantalla sd

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Danton 0:a11b3a90c259 1 #include "mbed.h"
Danton 0:a11b3a90c259 2 #include "SDFileSystem.h"
Danton 2:e205fa129def 3 #include "hx8340bs.h"
Danton 0:a11b3a90c259 4
Danton 4:06966d819846 5
Danton 5:90c04edc05d4 6
Danton 0:a11b3a90c259 7
Danton 0:a11b3a90c259 8 int main() {
Danton 6:ac9692245a01 9 printf("Hello Stinky World!\c\n");
Danton 0:a11b3a90c259 10
Danton 2:e205fa129def 11 //mkdir("/sd/mydir", 0777);
Danton 0:a11b3a90c259 12
Danton 5:90c04edc05d4 13 SDFileSystem sd(p11, p12, p13, p8, "sd"); // the pinout on the mbed Cool Components workshop board
Danton 6:ac9692245a01 14 unsigned char bitmap[100];
Danton 7:a6c5797b9604 15 unsigned int bytesRead;
Danton 3:4a9643fb389c 16 int i=0;
Danton 10:fe0ef95e853e 17 sd.disk_initialize();
Danton 9:53afaa0431af 18 FILE *fp =fopen("/sd/mydir/rose.bmp", "r");
Danton 6:ac9692245a01 19
Danton 0:a11b3a90c259 20 if(fp == NULL) {
Danton 2:e205fa129def 21 error("Could not open file\c\n");
Danton 0:a11b3a90c259 22 }
Danton 2:e205fa129def 23 //fprintf(fp, "Hello fun SD Card World!\c\n");
Danton 9:53afaa0431af 24 //fread ( void * ptr, size_t size, size_t count, FILE * stream );
Danton 9:53afaa0431af 25 fread((char*)bitmap,1,100,fp);
Danton 6:ac9692245a01 26 while(i<100)
Danton 3:4a9643fb389c 27 {
Danton 7:a6c5797b9604 28 printf("%x\n",bitmap[i]);
Danton 3:4a9643fb389c 29 i++;
Danton 3:4a9643fb389c 30 }
Danton 7:a6c5797b9604 31 printf("%d\n",bytesRead);
Danton 9:53afaa0431af 32 fclose(fp);
Danton 5:90c04edc05d4 33 HX8340S_LCD lcd( p9, p14, p13, p11);
Danton 2:e205fa129def 34 lcd.Initialize();
Danton 3:4a9643fb389c 35 lcd.ClearScreen();
Danton 7:a6c5797b9604 36 lcd.FillScreen(COLOR_BLUE);
Danton 7:a6c5797b9604 37 lcd.Print( "Hello, World!", CENTER, 25 );
Danton 7:a6c5797b9604 38 lcd.DrawBitmap(0,0,(bitmap_t*)bitmap,1);
Danton 7:a6c5797b9604 39
Danton 10:fe0ef95e853e 40 sd.disk_initialize();
Danton 10:fe0ef95e853e 41 fp =fopen("/sd/mydir/rose.bmp", "r");
Danton 10:fe0ef95e853e 42
Danton 10:fe0ef95e853e 43 if(fp == NULL) {
Danton 10:fe0ef95e853e 44 error("Could not open file\c\n");
Danton 10:fe0ef95e853e 45 }
Danton 10:fe0ef95e853e 46 //fprintf(fp, "Hello fun SD Card World!\c\n");
Danton 10:fe0ef95e853e 47 //fread ( void * ptr, size_t size, size_t count, FILE * stream );
Danton 10:fe0ef95e853e 48 fread((char*)bitmap,1,100,fp);
Danton 10:fe0ef95e853e 49 i=0;
Danton 10:fe0ef95e853e 50 while(i<100)
Danton 10:fe0ef95e853e 51 {
Danton 10:fe0ef95e853e 52 printf("%x\n",bitmap[i]);
Danton 10:fe0ef95e853e 53 i++;
Danton 10:fe0ef95e853e 54 }
Danton 0:a11b3a90c259 55
Danton 0:a11b3a90c259 56 printf("Goodbye World!\c\n");
Danton 0:a11b3a90c259 57 }