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