scrolling example code for SHARP LCD LS027B4DH01/LS027B7DH01, using AkiSpiLcd library
This is very basic library example to access a graphic LCD LS027B4DH01 or LS027B7DH01
Import libraryAkiSpiLcd
Basic library for SHARP LCD LS027B4DH01/LS027B7DH01
- schematic example1:
- schematic example2:
- example1 photo:
- example2 photo:
- example2 movie (mpeg4 movie):
Revision 3:8dbf3336dc66, committed 2014-05-06
- Comitter:
- k4zuki
- Date:
- Tue May 06 13:01:55 2014 +0000
- Parent:
- 2:3554ec6df722
- Child:
- 4:37321a3e4ed8
- Commit message:
- - SPI clock speed is changed to fit LCD's spec(10MHz -> 2MHz); - interval timer function removed
Changed in this revision
AkiSpiLcd.cpp | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/AkiSpiLcd.cpp Sun May 04 04:07:10 2014 +0000 +++ b/AkiSpiLcd.cpp Tue May 06 13:01:55 2014 +0000 @@ -9,7 +9,7 @@ { _cs=0; _spi.format(8,0); - _spi.frequency(10000000); + _spi.frequency(2000000); comflag = modeflag = clearflag = 0; _disp=1; }
--- a/main.cpp Sun May 04 04:07:10 2014 +0000 +++ b/main.cpp Tue May 06 13:01:55 2014 +0000 @@ -13,14 +13,14 @@ AkiSpiLcd LCD(MOSI_, SCK_, D2, D5); DigitalOut myled(LED1); -Ticker disp; +//Ticker disp; extern volatile const uint8_t hogepic[]; - +/* void dispinvert(void) { LCD.cominvert(); } - +*/ int main() { @@ -29,16 +29,16 @@ 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);*/ + 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);*/ } }