Simple animation demo.

Dependencies:   AkiSpiLcd mbed

Fork of AkiSpiLcd_example by Kazuki Yamamoto

main.cpp

Committer:
k4zuki
Date:
2014-05-06
Revision:
3:8dbf3336dc66
Parent:
1:be675380f70b
Child:
5:8883e74c0f11

File content as of revision 3:8dbf3336dc66:

#define MBEDSHIELD_050

#include "mbed.h"
#include "hogepic.h"
#include "AkiSpiLcd.h"

/*
1 SCLK D3=p13
2 MOSI D5=p11
3 CS D2=p14
4 DISP enable D5=p22
*/

AkiSpiLcd LCD(MOSI_, SCK_, D2, D5);
DigitalOut myled(LED1);
//Ticker disp;
extern volatile const uint8_t hogepic[];
/*
void dispinvert(void)
{
    LCD.cominvert();
}
*/
int main()
{

    wait_ms(1);
//    disp.attach(&dispinvert,0.1);
    LCD.cls();
    LCD.updateSingle(10,(uint8_t*)(hogepic+2000));
    LCD.updateMulti(100,(240-100),(uint8_t*)(hogepic));

    while(1) {
        for(int i=0; i<240; i++) {
            LCD.updateMulti(i,(240-i),(uint8_t*)(hogepic));
            LCD.updateMulti(0,(i),(uint8_t*)(hogepic+50*(240-i)));
        }
        /*        myled = 1;
                wait(0.2);
                myled = 0;
                wait(0.2);*/
    }
}