Sim mbed / Mbed 2 deprecated SPILCDsample

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // Sample of spilcd class
00002 #include "mbed.h"
00003 #include "spilcd.h"
00004 #include "miku.h"
00005 
00006 
00007 SPILCD lcd(p21, p22, p23, p11, p12, p13);
00008 
00009 void drawmiku(int pic){
00010     static const unsigned char *miku[6] = {
00011         miku1, miku2, miku3, miku4, miku5, miku6
00012     };
00013     int x, y;
00014     const unsigned char *p = miku[pic];
00015 
00016     for(y = 0; y < 8; y++){
00017         lcd.locate(53, y);
00018         for(x = 0; x < 75; x++) lcd.write(*p++);
00019     }
00020 }
00021 
00022 int main() {
00023     int pic = 0;
00024     while(1){
00025         drawmiku(pic);
00026         if(++pic == 6) pic = 0;
00027 
00028         wait_ms(100);
00029     }
00030 }