Demo for using bitmap graphic

Dependencies:   C12832_lcd LCD_fonts mbed

Fork of app-board-LCD by Chris Styles

A demo for the bitmap graphic :

Committer:
dreschpe
Date:
Fri Dec 21 21:59:16 2012 +0000
Revision:
3:48407a94ff89
Parent:
2:a87e255a8f3a
Happy Christmas !

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dreschpe 0:f6a57b843f79 1 #include "mbed.h"
dreschpe 1:1c6a9eaf55b5 2 #include "C12832_lcd.h"
dreschpe 3:48407a94ff89 3 #include "Arial_9.h"
dreschpe 3:48407a94ff89 4 #include "Small_7.h"
dreschpe 3:48407a94ff89 5 #include "graphics.h"
dreschpe 0:f6a57b843f79 6
chris 2:a87e255a8f3a 7 C12832_LCD lcd;
dreschpe 1:1c6a9eaf55b5 8
dreschpe 0:f6a57b843f79 9 int main()
dreschpe 0:f6a57b843f79 10 {
dreschpe 3:48407a94ff89 11 int i,s;
chris 2:a87e255a8f3a 12 lcd.cls();
dreschpe 3:48407a94ff89 13 lcd.set_font((unsigned char*) Arial_9);
dreschpe 3:48407a94ff89 14 s = 3;
dreschpe 3:48407a94ff89 15 lcd.print_bm(bitmTree,95,0); // print chistmas tree
dreschpe 3:48407a94ff89 16 lcd.copy_to_lcd();
dreschpe 3:48407a94ff89 17 lcd.setmode(XOR); // XOR - a second print will erase
dreschpe 3:48407a94ff89 18 for(i = -15; i < 75; ){
dreschpe 3:48407a94ff89 19 lcd.print_bm(bitmSan1,i,2);
dreschpe 3:48407a94ff89 20 wait(0.5);
dreschpe 3:48407a94ff89 21 lcd.copy_to_lcd(); // update lcd
dreschpe 3:48407a94ff89 22 lcd.print_bm(bitmSan1,i,2); // erase
dreschpe 3:48407a94ff89 23 i= i+s;
dreschpe 3:48407a94ff89 24 lcd.print_bm(bitmSan2,i,2); // print next
dreschpe 3:48407a94ff89 25 wait(0.5);
dreschpe 3:48407a94ff89 26 lcd.copy_to_lcd(); // update lcd
dreschpe 3:48407a94ff89 27 lcd.print_bm(bitmSan2,i,2); // erase
dreschpe 3:48407a94ff89 28 i= i+s;
dreschpe 3:48407a94ff89 29 lcd.print_bm(bitmSan3,i,2); // print next
dreschpe 3:48407a94ff89 30 wait(0.5);
dreschpe 3:48407a94ff89 31 lcd.copy_to_lcd(); // update lcd
dreschpe 3:48407a94ff89 32 lcd.print_bm(bitmSan3,i,2); // erase
dreschpe 3:48407a94ff89 33 i= i+s;
dreschpe 3:48407a94ff89 34 }
dreschpe 3:48407a94ff89 35 lcd.print_bm(bitmSan3,i,2);
dreschpe 3:48407a94ff89 36 lcd.set_auto_up(0);
dreschpe 3:48407a94ff89 37 for(i=-20; i<5; i++){ // scrolling text
dreschpe 3:48407a94ff89 38 lcd.locate(5,i);
dreschpe 3:48407a94ff89 39 lcd.printf("Happy");
dreschpe 3:48407a94ff89 40 lcd.locate(5,i+12);
dreschpe 3:48407a94ff89 41 lcd.printf("Christmas");
dreschpe 3:48407a94ff89 42 lcd.copy_to_lcd();
dreschpe 3:48407a94ff89 43 lcd.locate(5,i);
dreschpe 3:48407a94ff89 44 wait(0.2);
dreschpe 3:48407a94ff89 45 lcd.printf("Happy");
dreschpe 3:48407a94ff89 46 lcd.locate(5,i+12);
dreschpe 3:48407a94ff89 47 lcd.printf("Christmas");
dreschpe 3:48407a94ff89 48 lcd.copy_to_lcd();
dreschpe 3:48407a94ff89 49 i=i+1;
dreschpe 3:48407a94ff89 50 }
dreschpe 3:48407a94ff89 51 lcd.locate(5,i);
dreschpe 3:48407a94ff89 52 lcd.printf("Happy");
dreschpe 3:48407a94ff89 53 lcd.locate(5,i+12);
dreschpe 3:48407a94ff89 54 lcd.printf("Christmas");
dreschpe 3:48407a94ff89 55 lcd.copy_to_lcd();
dreschpe 3:48407a94ff89 56
dreschpe 0:f6a57b843f79 57 }