cauqleuir madre
Dependencies: SDFileSystem mbed TFTLCD
main.cpp@5:90c04edc05d4, 2013-02-01 (annotated)
- Committer:
- Danton
- Date:
- Fri Feb 01 20:57:45 2013 +0000
- Revision:
- 5:90c04edc05d4
- Parent:
- 4:06966d819846
- Child:
- 6:ac9692245a01
mamon
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 | 5:90c04edc05d4 | 6 | |
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 | 5:90c04edc05d4 | 14 | SDFileSystem sd(p11, p12, p13, p8, "sd"); // the pinout on the mbed Cool Components workshop board |
Danton | 3:4a9643fb389c | 15 | unsigned char bitmap[116215]; |
Danton | 3:4a9643fb389c | 16 | int i=0; |
Danton | 3:4a9643fb389c | 17 | FILE *fp = fopen("/sd/mydir/rose.bmp", "r"); |
Danton | 3:4a9643fb389c | 18 | unsigned char *aux=(unsigned char*)fp; |
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 | 3:4a9643fb389c | 23 | while(i<116215) |
Danton | 3:4a9643fb389c | 24 | { |
Danton | 3:4a9643fb389c | 25 | bitmap[i]=aux[i]; |
Danton | 3:4a9643fb389c | 26 | i++; |
Danton | 3:4a9643fb389c | 27 | } |
Danton | 2:e205fa129def | 28 | |
Danton | 5:90c04edc05d4 | 29 | HX8340S_LCD lcd( p9, p14, p13, p11); |
Danton | 2:e205fa129def | 30 | lcd.Initialize(); |
Danton | 3:4a9643fb389c | 31 | lcd.ClearScreen(); |
Danton | 3:4a9643fb389c | 32 | lcd.DrawBitmap(0,0,(bitmap_t*)bitmap,1); |
Danton | 0:a11b3a90c259 | 33 | fclose(fp); |
Danton | 0:a11b3a90c259 | 34 | |
Danton | 0:a11b3a90c259 | 35 | printf("Goodbye World!\c\n"); |
Danton | 0:a11b3a90c259 | 36 | } |