Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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):
Diff: main.cpp
- Revision:
- 10:49b29e3c9d9c
- Parent:
- 9:3f19d3e5d2a0
diff -r 3f19d3e5d2a0 -r 49b29e3c9d9c main.cpp
--- a/main.cpp Thu Oct 02 18:14:38 2014 +0000
+++ b/main.cpp Wed Jul 15 17:24:40 2015 +0000
@@ -1,20 +1,28 @@
-#define MBEDSHIELD_050
-
#include "mbed.h"
-#include "hogepic.h"
#include "AkiSpiLcd.h"
+#if defined(TARGET_LPC1768)
+#include "hogepic.h"
+extern const uint8_t hogepic[];
+#include "invader_modoki.h"
+extern const uint8_t invader_modoki[];
/*
1 SCLK D3=p13
2 MOSI D5=p11
3 CS D2=p14
4 DISP enable D5=p22
*/
-
-AkiSpiLcd LCD(MOSI_, MISO_, SCK_, p9, p10);
+AkiSpiLcd LCD(p11, p12, p13, p9, p10);
+DigitalOut myled(p22);
-DigitalOut myled(D5);
-extern const uint8_t hogepic[];
+#elif defined(TARGET_SSCI824)
+#include "invader_modoki.h"
+extern const uint8_t invader_modoki[];
+
+AkiSpiLcd LCD(dp10, dp9, dp8, dp7, dp6);
+DigitalOut myled(dp18);
+#endif
+
int main()
{
@@ -26,20 +34,37 @@
// wait_ms(1);
LCD.cls();
LCD.cls_ram(SCREEN0);
+ LCD.cls_ram(SCREEN1);
myled=0;
- LCD.ramWriteMultiLine(1,240,(uint8_t*)(hogepic),SCREEN0);
- LCD.ram2lcd(1,240,SCREEN0);
+// LCD.ramWriteMultiLine(1,240,(uint8_t*)(hogepic),SCREEN0);
+// LCD.ramWriteMultiLine(1,240,(uint8_t*)(invader_modoki),SCREEN1);
+// LCD.ram2lcd(1,240,SCREEN0);
+// int screen[2] = {SCREEN0,SCREEN1};
while(1) {
+ /*
+ if(screen[1] ==0) {
+ screen[0]=SCREEN0,screen[1]=SCREEN1;
+ } else {
+ screen[1]=SCREEN0,screen[0]=SCREEN1;
+ }
+ */
+ myled=1;
+// LCD.cls( );
+ LCD.ram2lcd(SCREEN0);
+ myled=0;
+ LCD.ram2lcd(SCREEN1);
+ /*
for(int i=1; i<=240; i++) {
-// LCD.ramReadSingle(i,read,SCREEN0);
- LCD.ram2lcd(i,240-i,SCREEN0);
- myled=1;
- LCD.ram2lcd(1,i,SCREEN0);
- myled=0;
-// LCD.directUpdateMulti(i,(240-i),(uint8_t*)(hogepic));
-// LCD.directUpdateMulti(1,(i),(uint8_t*)(hogepic+50*(240-i)));
+ // LCD.ramReadSingle(i,read,SCREEN0);
+ LCD.ram2lcd(1,i,screen[1]);
+ myled=1;
+ LCD.ram2lcd(i+1,240-i+1,screen[0]);
+ myled=0;
+ // LCD.directUpdateMulti(i,(240-i),(uint8_t*)(hogepic));
+ // LCD.directUpdateMulti(1,(i),(uint8_t*)(hogepic+50*(240-i)));
}
+ */
}
}
