AirsoftTimer software based on mbed

Dependencies:   mbed TextLCD keypad

Committer:
sillevl
Date:
Thu Feb 09 12:28:56 2017 +0000
Revision:
27:f29805113454
Parent:
9:b587bae22691
ARCHIVE WIP, not working (crashes, cause unknown)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 4:2c91c9eccf3a 1 #include "LCD.h"
sillevl 4:2c91c9eccf3a 2
sillevl 4:2c91c9eccf3a 3 LCD::LCD(PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7, LCDType type) : TextLCD(rs, e, d4, d5, d6, d7, type) {
sillevl 9:b587bae22691 4 //load special characters in memory
sillevl 9:b587bae22691 5 load_special_chars();
sillevl 5:be598835bab0 6 }
sillevl 5:be598835bab0 7
sillevl 5:be598835bab0 8 void LCD::showLogo(const char** logo){
sillevl 5:be598835bab0 9 for(int line = 0; line < 4; line++){
sillevl 5:be598835bab0 10 this->locate(0,line);
sillevl 5:be598835bab0 11 this->printf(logo[line]);
sillevl 5:be598835bab0 12 }
sillevl 9:b587bae22691 13 }
sillevl 9:b587bae22691 14
sillevl 9:b587bae22691 15 void LCD::load_special_chars(){
sillevl 9:b587bae22691 16 char special_chars[8][8] = {
sillevl 9:b587bae22691 17 {0x0,0x8,0xc,0xe,0xc,0x8,0x0}, // [0] arrow right
sillevl 9:b587bae22691 18 {0x0,0x2,0x6,0xe,0x6,0x2,0x0}, // [1] arrow left
sillevl 9:b587bae22691 19 {0x0,0x0,0x4,0xe,0x1f,0x0,0x0}, // [2] arrow up
sillevl 9:b587bae22691 20 {0x0,0x0,0x1f,0xe,0x4,0x0,0x0}, // [3] arrow down
sillevl 9:b587bae22691 21 {0x0,0xe,0x15,0x17,0x11,0xe,0x0}, // [4] clock
sillevl 9:b587bae22691 22 {0x1,0x3,0xf,0xf,0xf,0x3,0x1}, // [5] speaker
sillevl 9:b587bae22691 23 {0x8,0x10,0x0,0x18,0x0,0x10,0x8}, // [6] speaker on
sillevl 9:b587bae22691 24 {0x0,0x1,0x3,0x16,0x1c,0x8,0x0} // [7] check mark
sillevl 9:b587bae22691 25 };
sillevl 9:b587bae22691 26 for(int i = 0; i < 8; i++){
sillevl 9:b587bae22691 27 this->putCustomChar(i,special_chars[i]);
sillevl 9:b587bae22691 28 }
sillevl 9:b587bae22691 29 }