cauqleuir madre

Dependencies:   SDFileSystem mbed TFTLCD

Committer:
Danton
Date:
Fri Feb 01 22:29:09 2013 +0000
Revision:
9:53afaa0431af
Parent:
8:12732c85642b
Child:
10:fe0ef95e853e
popo;

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 9:53afaa0431af 17 FILE *fp =fopen("/sd/mydir/rose.bmp", "r");
Danton 6:ac9692245a01 18
Danton 0:a11b3a90c259 19 if(fp == NULL) {
Danton 2:e205fa129def 20 error("Could not open file\c\n");
Danton 0:a11b3a90c259 21 }
Danton 2:e205fa129def 22 //fprintf(fp, "Hello fun SD Card World!\c\n");
Danton 9:53afaa0431af 23 //fread ( void * ptr, size_t size, size_t count, FILE * stream );
Danton 9:53afaa0431af 24 fread((char*)bitmap,1,100,fp);
Danton 6:ac9692245a01 25 while(i<100)
Danton 3:4a9643fb389c 26 {
Danton 7:a6c5797b9604 27 printf("%x\n",bitmap[i]);
Danton 3:4a9643fb389c 28 i++;
Danton 3:4a9643fb389c 29 }
Danton 7:a6c5797b9604 30 printf("%d\n",bytesRead);
Danton 9:53afaa0431af 31 fclose(fp);
Danton 5:90c04edc05d4 32 HX8340S_LCD lcd( p9, p14, p13, p11);
Danton 2:e205fa129def 33 lcd.Initialize();
Danton 3:4a9643fb389c 34 lcd.ClearScreen();
Danton 7:a6c5797b9604 35 lcd.FillScreen(COLOR_BLUE);
Danton 7:a6c5797b9604 36 lcd.Print( "Hello, World!", CENTER, 25 );
Danton 7:a6c5797b9604 37 lcd.DrawBitmap(0,0,(bitmap_t*)bitmap,1);
Danton 7:a6c5797b9604 38
Danton 0:a11b3a90c259 39
Danton 0:a11b3a90c259 40 printf("Goodbye World!\c\n");
Danton 0:a11b3a90c259 41 }