cauqleuir madre
Dependencies: SDFileSystem mbed TFTLCD
main.cpp@7:a6c5797b9604, 2013-02-01 (annotated)
- Committer:
- Danton
- Date:
- Fri Feb 01 22:01:53 2013 +0000
- Revision:
- 7:a6c5797b9604
- Parent:
- 6:ac9692245a01
- Child:
- 8:12732c85642b
fread
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 | 7:a6c5797b9604 | 15 | unsigned int bytesRead; |
Danton | 3:4a9643fb389c | 16 | int i=0; |
Danton | 3:4a9643fb389c | 17 | FILE *fp = fopen("/sd/mydir/rose.bmp", "r"); |
Danton | 6:ac9692245a01 | 18 | |
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 | 7:a6c5797b9604 | 23 | fread(fp,(void*)bitmap,99,&bytesRead); |
Danton | 6:ac9692245a01 | 24 | while(i<100) |
Danton | 3:4a9643fb389c | 25 | { |
Danton | 7:a6c5797b9604 | 26 | printf("%x\n",bitmap[i]); |
Danton | 3:4a9643fb389c | 27 | i++; |
Danton | 3:4a9643fb389c | 28 | } |
Danton | 7:a6c5797b9604 | 29 | printf("%d\n",bytesRead); |
Danton | 7:a6c5797b9604 | 30 | fclose(fp); |
Danton | 5:90c04edc05d4 | 31 | HX8340S_LCD lcd( p9, p14, p13, p11); |
Danton | 2:e205fa129def | 32 | lcd.Initialize(); |
Danton | 3:4a9643fb389c | 33 | lcd.ClearScreen(); |
Danton | 7:a6c5797b9604 | 34 | lcd.FillScreen(COLOR_BLUE); |
Danton | 7:a6c5797b9604 | 35 | lcd.Print( "Hello, World!", CENTER, 25 ); |
Danton | 7:a6c5797b9604 | 36 | lcd.DrawBitmap(0,0,(bitmap_t*)bitmap,1); |
Danton | 7:a6c5797b9604 | 37 | |
Danton | 0:a11b3a90c259 | 38 | |
Danton | 0:a11b3a90c259 | 39 | printf("Goodbye World!\c\n"); |
Danton | 0:a11b3a90c259 | 40 | } |