cauqleuir madre
Dependencies: SDFileSystem mbed TFTLCD
main.cpp@4:06966d819846, 2013-02-01 (annotated)
- Committer:
- Danton
- Date:
- Fri Feb 01 20:52:27 2013 +0000
- Revision:
- 4:06966d819846
- Parent:
- 3:4a9643fb389c
- Child:
- 5:90c04edc05d4
mmm
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 | 4:06966d819846 | 5 | |
Danton | 2:e205fa129def | 6 | SDFileSystem sd(p11, p12, p13, p8, "sd"); // the pinout on the mbed Cool Components workshop board |
Danton | 0:a11b3a90c259 | 7 | |
Danton | 0:a11b3a90c259 | 8 | int main() { |
Danton | 0:a11b3a90c259 | 9 | printf("Hello Stinky World!\c\n"); |
Danton | 2:e205fa129def | 10 | |
Danton | 0:a11b3a90c259 | 11 | |
Danton | 2:e205fa129def | 12 | //mkdir("/sd/mydir", 0777); |
Danton | 0:a11b3a90c259 | 13 | |
Danton | 3:4a9643fb389c | 14 | unsigned char bitmap[116215]; |
Danton | 3:4a9643fb389c | 15 | int i=0; |
Danton | 3:4a9643fb389c | 16 | FILE *fp = fopen("/sd/mydir/rose.bmp", "r"); |
Danton | 3:4a9643fb389c | 17 | unsigned char *aux=(unsigned char*)fp; |
Danton | 0:a11b3a90c259 | 18 | if(fp == NULL) { |
Danton | 2:e205fa129def | 19 | error("Could not open file\c\n"); |
Danton | 0:a11b3a90c259 | 20 | } |
Danton | 2:e205fa129def | 21 | //fprintf(fp, "Hello fun SD Card World!\c\n"); |
Danton | 3:4a9643fb389c | 22 | while(i<116215) |
Danton | 3:4a9643fb389c | 23 | { |
Danton | 3:4a9643fb389c | 24 | bitmap[i]=aux[i]; |
Danton | 3:4a9643fb389c | 25 | i++; |
Danton | 3:4a9643fb389c | 26 | } |
Danton | 2:e205fa129def | 27 | |
Danton | 4:06966d819846 | 28 | HX8340S_LCD lcd( p9, p14, p13, p11 ); |
Danton | 2:e205fa129def | 29 | lcd.Initialize(); |
Danton | 3:4a9643fb389c | 30 | lcd.ClearScreen(); |
Danton | 3:4a9643fb389c | 31 | lcd.DrawBitmap(0,0,(bitmap_t*)bitmap,1); |
Danton | 0:a11b3a90c259 | 32 | fclose(fp); |
Danton | 0:a11b3a90c259 | 33 | |
Danton | 0:a11b3a90c259 | 34 | printf("Goodbye World!\c\n"); |
Danton | 0:a11b3a90c259 | 35 | } |