cauqleuir madre
Dependencies: SDFileSystem mbed TFTLCD
main.cpp@16:e7f9136d440f, 2013-02-02 (annotated)
- Committer:
- Danton
- Date:
- Sat Feb 02 00:22:03 2013 +0000
- Revision:
- 16:e7f9136d440f
- Parent:
- 15:3bfbb557020e
- Child:
- 17:3d7951357fd3
amabilidad ante todo
Who changed what in which revision?
User | Revision | Line number | New 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 | 15:3bfbb557020e | 5 | void superSd(unsigned char*buffer,int offset,const char *path) |
Danton | 15:3bfbb557020e | 6 | { |
Danton | 15:3bfbb557020e | 7 | SDFileSystem sd(p11, p12, p13, p8, "sd"); // the pinout on the mbed Cool Components workshop board |
Danton | 15:3bfbb557020e | 8 | FILE *fp =fopen("/sd/mydir/rose.bmp", "r"); |
Danton | 15:3bfbb557020e | 9 | |
Danton | 15:3bfbb557020e | 10 | if(fp == NULL) { |
Danton | 15:3bfbb557020e | 11 | error("Could not open file\c\n"); |
Danton | 15:3bfbb557020e | 12 | } |
Danton | 15:3bfbb557020e | 13 | //fprintf(fp, "Hello fun SD Card World!\c\n"); |
Danton | 15:3bfbb557020e | 14 | //fread ( void * ptr, size_t size, size_t count, FILE * stream ); |
Danton | 15:3bfbb557020e | 15 | fread((char*)buffer,1,100,fp); |
Danton | 15:3bfbb557020e | 16 | fclose(fp); |
Danton | 15:3bfbb557020e | 17 | |
Danton | 15:3bfbb557020e | 18 | } |
Danton | 15:3bfbb557020e | 19 | void superDisplay(unsigned char*buffer,int offset,const char *path) |
Danton | 15:3bfbb557020e | 20 | { |
Danton | 15:3bfbb557020e | 21 | HX8340S_LCD lcd( p9, p14, p13, p11); |
Danton | 15:3bfbb557020e | 22 | lcd.Initialize(); |
Danton | 15:3bfbb557020e | 23 | lcd.ClearScreen(); |
Danton | 15:3bfbb557020e | 24 | lcd.FillScreen(COLOR_BLUE); |
Danton | 15:3bfbb557020e | 25 | lcd.Print(path, CENTER, 25 ); |
Danton | 15:3bfbb557020e | 26 | lcd.DrawBitmap(0,0,(bitmap_t*)buffer,1); |
Danton | 15:3bfbb557020e | 27 | } |
Danton | 0:a11b3a90c259 | 28 | |
Danton | 0:a11b3a90c259 | 29 | int main() { |
Danton | 6:ac9692245a01 | 30 | printf("Hello Stinky World!\c\n"); |
Danton | 0:a11b3a90c259 | 31 | |
Danton | 2:e205fa129def | 32 | //mkdir("/sd/mydir", 0777); |
Danton | 0:a11b3a90c259 | 33 | |
Danton | 15:3bfbb557020e | 34 | |
Danton | 6:ac9692245a01 | 35 | unsigned char bitmap[100]; |
Danton | 3:4a9643fb389c | 36 | int i=0; |
Danton | 15:3bfbb557020e | 37 | superSd(bitmap,0,"/sd/mydir/rose.bmp"); |
Danton | 6:ac9692245a01 | 38 | while(i<100) |
Danton | 3:4a9643fb389c | 39 | { |
Danton | 7:a6c5797b9604 | 40 | printf("%x\n",bitmap[i]); |
Danton | 3:4a9643fb389c | 41 | i++; |
Danton | 3:4a9643fb389c | 42 | } |
Danton | 15:3bfbb557020e | 43 | superDisplay(bitmap,0,"Hola imbecil"); |
Danton | 15:3bfbb557020e | 44 | superSd(bitmap,0,"/sd/mydir/rose.bmp"); |
Danton | 15:3bfbb557020e | 45 | i=0; |
Danton | 15:3bfbb557020e | 46 | while(i<100) |
Danton | 15:3bfbb557020e | 47 | { |
Danton | 15:3bfbb557020e | 48 | printf("%x\n",bitmap[i]); |
Danton | 15:3bfbb557020e | 49 | i++; |
Danton | 15:3bfbb557020e | 50 | } |
Danton | 16:e7f9136d440f | 51 | superDisplay(bitmap,0,"Whats the != between 1&2"); |
Danton | 15:3bfbb557020e | 52 | |
Danton | 0:a11b3a90c259 | 53 | printf("Goodbye World!\c\n"); |
Danton | 0:a11b3a90c259 | 54 | } |