cauqleuir madre
Dependencies: SDFileSystem mbed TFTLCD
main.cpp
- Committer:
- Danton
- Date:
- 2013-02-02
- Revision:
- 15:3bfbb557020e
- Parent:
- 14:48124641f4b1
- Child:
- 16:e7f9136d440f
File content as of revision 15:3bfbb557020e:
#include "mbed.h" #include "SDFileSystem.h" #include "hx8340bs.h" void superSd(unsigned char*buffer,int offset,const char *path) { SDFileSystem sd(p11, p12, p13, p8, "sd"); // the pinout on the mbed Cool Components workshop board FILE *fp =fopen("/sd/mydir/rose.bmp", "r"); if(fp == NULL) { error("Could not open file\c\n"); } //fprintf(fp, "Hello fun SD Card World!\c\n"); //fread ( void * ptr, size_t size, size_t count, FILE * stream ); fread((char*)buffer,1,100,fp); fclose(fp); } void superDisplay(unsigned char*buffer,int offset,const char *path) { HX8340S_LCD lcd( p9, p14, p13, p11); lcd.Initialize(); lcd.ClearScreen(); lcd.FillScreen(COLOR_BLUE); lcd.Print(path, CENTER, 25 ); lcd.DrawBitmap(0,0,(bitmap_t*)buffer,1); } int main() { printf("Hello Stinky World!\c\n"); //mkdir("/sd/mydir", 0777); unsigned char bitmap[100]; int i=0; superSd(bitmap,0,"/sd/mydir/rose.bmp"); while(i<100) { printf("%x\n",bitmap[i]); i++; } superDisplay(bitmap,0,"Hola imbecil"); superSd(bitmap,0,"/sd/mydir/rose.bmp"); i=0; while(i<100) { printf("%x\n",bitmap[i]); i++; } superDisplay(bitmap,0,"que paso idiota"); printf("Goodbye World!\c\n"); }