SG12864A

Dependents:   SG12864A_TestProgram

main.cpp

Committer:
shintamainjp
Date:
2010-07-19
Revision:
0:238f2d048222
Child:
1:aacd73a4e7ee

File content as of revision 0:238f2d048222:

/**
 * SG12864A Graphics LCD module driver class (Version 0.0.1)
 *
 * Copyright (C) 2010 Shinichiro Nakamura (CuBeatSystems)
 * http://shinta.main.jp/
 */

#include "mbed.h"
#include "SG12864A.h"

int main() {

    SG12864A lcd(p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18);

    lcd.reset();

    {
        static const int pages = 8;
        static const int columns = 64;
        for (int i = 0; i < pages; i++) {
            lcd.setPageAddress(SG12864A::CS1, i);
            lcd.setPageAddress(SG12864A::CS2, i);
            for (int j = 0; j < columns; j++) {
                uint8_t n = 1 << (j % 8);
                lcd.setColumnAddress(SG12864A::CS1, j);
                lcd.setColumnAddress(SG12864A::CS2, j);
                lcd.writeData(SG12864A::CS1, n);
                lcd.writeData(SG12864A::CS2, n);
            }
        }
    }

    uint8_t n = 0;
    while (1) {
        lcd.setDisplayStartLine(SG12864A::CS1, n);
        lcd.setDisplayStartLine(SG12864A::CS2, n);
        n++;
        wait_ms(100);
    }
}