cauqleuir madre

Dependencies:   SDFileSystem mbed TFTLCD

main.cpp

Committer:
Danton
Date:
2013-02-01
Revision:
5:90c04edc05d4
Parent:
4:06966d819846
Child:
6:ac9692245a01

File content as of revision 5:90c04edc05d4:

#include "mbed.h"
#include "SDFileSystem.h"
#include "hx8340bs.h"



 
int main() {
    printf("Hello Stinky World!\c\n");   
    
 
    //mkdir("/sd/mydir", 0777);
    
    SDFileSystem sd(p11, p12, p13, p8, "sd"); // the pinout on the mbed Cool Components workshop board
    unsigned char bitmap[116215];
    int i=0;
    FILE *fp = fopen("/sd/mydir/rose.bmp", "r");
    unsigned char *aux=(unsigned char*)fp;
    if(fp == NULL) {
        error("Could not open file\c\n");
    }
    //fprintf(fp, "Hello fun SD Card World!\c\n");
    while(i<116215)
    {
        bitmap[i]=aux[i];
        i++;
    }
    
    HX8340S_LCD lcd( p9, p14, p13, p11);
    lcd.Initialize();
    lcd.ClearScreen();
    lcd.DrawBitmap(0,0,(bitmap_t*)bitmap,1);
    fclose(fp); 
 
    printf("Goodbye World!\c\n");
}