cauqleuir madre
Dependencies: SDFileSystem mbed TFTLCD
Diff: main.cpp
- Revision:
- 7:a6c5797b9604
- Parent:
- 6:ac9692245a01
- Child:
- 8:12732c85642b
diff -r ac9692245a01 -r a6c5797b9604 main.cpp --- a/main.cpp Fri Feb 01 21:24:30 2013 +0000 +++ b/main.cpp Fri Feb 01 22:01:53 2013 +0000 @@ -12,6 +12,7 @@ SDFileSystem sd(p11, p12, p13, p8, "sd"); // the pinout on the mbed Cool Components workshop board unsigned char bitmap[100]; + unsigned int bytesRead; int i=0; FILE *fp = fopen("/sd/mydir/rose.bmp", "r"); @@ -19,20 +20,21 @@ error("Could not open file\c\n"); } //fprintf(fp, "Hello fun SD Card World!\c\n"); - unsigned char *aux=(unsigned char*)fp; + fread(fp,(void*)bitmap,99,&bytesRead); while(i<100) { - bitmap[i]=aux[i]; - printf("%x\n",bitmap) + printf("%x\n",bitmap[i]); i++; } - + printf("%d\n",bytesRead); + fclose(fp); HX8340S_LCD lcd( p9, p14, p13, p11); lcd.Initialize(); lcd.ClearScreen(); - lcd.FillScreen(COLOR_BLUE); - //lcd.DrawBitmap(0,0,(bitmap_t*)bitmap,1); - fclose(fp); + lcd.FillScreen(COLOR_BLUE); + lcd.Print( "Hello, World!", CENTER, 25 ); + lcd.DrawBitmap(0,0,(bitmap_t*)bitmap,1); + printf("Goodbye World!\c\n"); } \ No newline at end of file