SG12864A
Dependents: SG12864A_TestProgram
Diff: main.cpp
- Revision:
- 0:238f2d048222
- Child:
- 1:aacd73a4e7ee
diff -r 000000000000 -r 238f2d048222 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jul 19 12:43:25 2010 +0000 @@ -0,0 +1,40 @@ +/** + * 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); + } +}