Utilizando a Nucleo F103RB com um módulo LCD e um Joystick para interface

Dependencies:   mbed

Committer:
rhisis
Date:
Tue Jun 09 00:49:52 2020 +0000
Revision:
1:ac6e904944c3
Parent:
0:bf743d54917c
Child:
9:891ffa97d8fb
comentarios na biblioteca lcd cpp

Who changed what in which revision?

UserRevisionLine numberNew contents of line
kaiquedog 0:bf743d54917c 1 #include "LCD_ka.h"
kaiquedog 0:bf743d54917c 2 /*
kaiquedog 0:bf743d54917c 3 ***********************
kaiquedog 0:bf743d54917c 4 **** INICIALIZAÇÃO ****
kaiquedog 0:bf743d54917c 5 ***********************
kaiquedog 0:bf743d54917c 6 */
kaiquedog 0:bf743d54917c 7 LCD::LCD(PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7) : RS(rs), E(e), dados(d4,d5,d6,d7){
kaiquedog 0:bf743d54917c 8 Inicia_LCD();
kaiquedog 0:bf743d54917c 9 setup_chars();
kaiquedog 0:bf743d54917c 10 this ->_coluna = 1;
kaiquedog 0:bf743d54917c 11 this ->_linha = 1;
kaiquedog 0:bf743d54917c 12 }
kaiquedog 0:bf743d54917c 13
kaiquedog 0:bf743d54917c 14
kaiquedog 0:bf743d54917c 15 /*
kaiquedog 0:bf743d54917c 16 ********************
kaiquedog 0:bf743d54917c 17 **** INICIA_LCD ****
kaiquedog 0:bf743d54917c 18 ********************
kaiquedog 0:bf743d54917c 19 */
kaiquedog 0:bf743d54917c 20 void LCD::Inicia_LCD(void){
kaiquedog 0:bf743d54917c 21 RS = 0;
kaiquedog 0:bf743d54917c 22 E = 0;
kaiquedog 0:bf743d54917c 23 dados = 0x0;
kaiquedog 0:bf743d54917c 24 wait(0.05);
kaiquedog 0:bf743d54917c 25 for (int i=0; i<3; i++){
kaiquedog 0:bf743d54917c 26 CMD(0x20); // Define como 4 bits
kaiquedog 0:bf743d54917c 27
kaiquedog 0:bf743d54917c 28 CMD(0x28); // Define 0 0 1 DL - N F _ _
kaiquedog 0:bf743d54917c 29 //(DL = Data Lengh: 0 --> 4 Bits
kaiquedog 0:bf743d54917c 30 // 1 --> 8 Bits)
kaiquedog 0:bf743d54917c 31 //(N = n° de linhas:0 --> 1 linha
kaiquedog 0:bf743d54917c 32 // 1 --> 2 linhas)
kaiquedog 0:bf743d54917c 33 //(F = n° de pontos:0 --> 5 x 8 pontos
kaiquedog 0:bf743d54917c 34 // 1 --> 5 x 10 pontos)
kaiquedog 0:bf743d54917c 35
kaiquedog 0:bf743d54917c 36
kaiquedog 0:bf743d54917c 37 CMD(0x0E); // Define 0 0 0 0 - 1 D C B
kaiquedog 0:bf743d54917c 38 //(D = Display on/off: 0 --> off
kaiquedog 0:bf743d54917c 39 // 1 --> on)
kaiquedog 0:bf743d54917c 40 //(C = Cursor on/off : 0 --> off
kaiquedog 0:bf743d54917c 41 // 1 --> on)
kaiquedog 0:bf743d54917c 42 //(B = Blink on/off : 0 --> off
kaiquedog 0:bf743d54917c 43 // 1 --> on)
kaiquedog 0:bf743d54917c 44
kaiquedog 0:bf743d54917c 45
kaiquedog 0:bf743d54917c 46 CMD(0x06); // Define 0 0 0 0 - 0 1 I/D S
kaiquedog 0:bf743d54917c 47 //(I/D = Direção de escrita: 0 --> Direita
kaiquedog 0:bf743d54917c 48 // 1 --> Esquerda)
kaiquedog 0:bf743d54917c 49 //(S = Display shift : 0 --> Não
kaiquedog 0:bf743d54917c 50 // 1 --> Sim)
kaiquedog 0:bf743d54917c 51 }
kaiquedog 0:bf743d54917c 52 clc(); // Limpa o diplay
kaiquedog 0:bf743d54917c 53 }
kaiquedog 0:bf743d54917c 54
kaiquedog 0:bf743d54917c 55 /*
kaiquedog 0:bf743d54917c 56 **********************
kaiquedog 0:bf743d54917c 57 **** FIM DE CURSO ****
kaiquedog 0:bf743d54917c 58 **********************
kaiquedog 0:bf743d54917c 59 */
kaiquedog 0:bf743d54917c 60 void LCD::fim_de_curso (void){
kaiquedog 0:bf743d54917c 61 switch (_coluna){
kaiquedog 0:bf743d54917c 62 case 17 : // Se a coluna for igual a 17
kaiquedog 0:bf743d54917c 63 switch (_linha){ // o cursor vai para:
kaiquedog 0:bf743d54917c 64 case 1 : pos(2,1); break; // Linha debaixo
kaiquedog 0:bf743d54917c 65 case 2 : home(); break; // Posição (1,1)
kaiquedog 0:bf743d54917c 66 }
kaiquedog 0:bf743d54917c 67 break;
kaiquedog 0:bf743d54917c 68
kaiquedog 0:bf743d54917c 69 case 0 : // Se a coluna for igual a 0
kaiquedog 0:bf743d54917c 70 switch (_linha){ // o cursor vai para:
kaiquedog 0:bf743d54917c 71 case 1 : pos(2,16); break; // Linha debaixo
kaiquedog 0:bf743d54917c 72 case 2 : pos(1,16); break; // Linha de cima
kaiquedog 0:bf743d54917c 73 }
kaiquedog 0:bf743d54917c 74 break;
kaiquedog 0:bf743d54917c 75 }
kaiquedog 0:bf743d54917c 76 }
kaiquedog 0:bf743d54917c 77
kaiquedog 0:bf743d54917c 78 /*
kaiquedog 0:bf743d54917c 79 *********************
kaiquedog 0:bf743d54917c 80 **** BATE ENABLE ****
kaiquedog 0:bf743d54917c 81 *********************
kaiquedog 0:bf743d54917c 82 */
kaiquedog 0:bf743d54917c 83 void LCD::bate_enable(void){
kaiquedog 0:bf743d54917c 84 E = 1;
kaiquedog 0:bf743d54917c 85 wait(0.000040f);
kaiquedog 0:bf743d54917c 86 E=0;
kaiquedog 0:bf743d54917c 87 wait(0.000040f);
kaiquedog 0:bf743d54917c 88 }
kaiquedog 0:bf743d54917c 89
kaiquedog 0:bf743d54917c 90 /*
kaiquedog 0:bf743d54917c 91 *************
kaiquedog 0:bf743d54917c 92 **** WRI ****
kaiquedog 0:bf743d54917c 93 *************
kaiquedog 0:bf743d54917c 94 */
kaiquedog 0:bf743d54917c 95 void LCD::WRI(int value){
kaiquedog 0:bf743d54917c 96 RS = 1;
kaiquedog 0:bf743d54917c 97 dados = value>>4;
kaiquedog 0:bf743d54917c 98 bate_enable();
kaiquedog 0:bf743d54917c 99 dados = value;
kaiquedog 0:bf743d54917c 100 bate_enable();
kaiquedog 0:bf743d54917c 101 }
kaiquedog 0:bf743d54917c 102
kaiquedog 0:bf743d54917c 103 /*
kaiquedog 0:bf743d54917c 104 *************
kaiquedog 0:bf743d54917c 105 **** CMD ****
kaiquedog 0:bf743d54917c 106 *************
kaiquedog 0:bf743d54917c 107 */
kaiquedog 0:bf743d54917c 108 void LCD::CMD(int value){
kaiquedog 0:bf743d54917c 109 RS = 0;
kaiquedog 0:bf743d54917c 110 dados = value>>4;
kaiquedog 0:bf743d54917c 111 bate_enable();
kaiquedog 0:bf743d54917c 112 dados = value;
kaiquedog 0:bf743d54917c 113 bate_enable();
kaiquedog 0:bf743d54917c 114 }
kaiquedog 0:bf743d54917c 115
kaiquedog 0:bf743d54917c 116 /*
kaiquedog 0:bf743d54917c 117 *********************
kaiquedog 0:bf743d54917c 118 **** SETUP_CHARS ****
kaiquedog 0:bf743d54917c 119 *********************
kaiquedog 0:bf743d54917c 120 */
kaiquedog 0:bf743d54917c 121 void LCD::setup_chars(){
rhisis 1:ac6e904944c3 122 int new_chars[] = {0x00, 0x01, 0x03, 0x16, 0x1c, 0x08, 0x00, 0x00, // Correto (0)
rhisis 1:ac6e904944c3 123 0x00, 0x0A, 0x0A, 0x0A, 0x00, 0x11, 0x0E, 0x00, // Sorriso (1)
rhisis 1:ac6e904944c3 124 0x0e, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x0e, 0x00, // Relógio (2)
rhisis 1:ac6e904944c3 125 0x00, 0x04, 0x0E, 0x15, 0x04, 0x04, 0x00, 0x00, // Seta para cima (3)
rhisis 1:ac6e904944c3 126 0x00, 0x00, 0x04, 0x04, 0x15, 0x0E, 0x04, 0x00, // Seta para baixo (4)
rhisis 1:ac6e904944c3 127 0x0e, 0x11, 0x05, 0x09, 0x1e, 0x08, 0x04, 0x00, // Seta Horário (5)
rhisis 1:ac6e904944c3 128 0x0e, 0x11, 0x14, 0x12, 0x0f, 0x02, 0x04, 0x00, // Seta Anti_horário (6)
rhisis 1:ac6e904944c3 129 0x00, 0x04, 0x08, 0x17, 0x08, 0x04, 0x00, 0x00, // Seta para Esquerda (7)
rhisis 1:ac6e904944c3 130 0x00, 0x04, 0x02, 0x1d, 0x02, 0x04, 0x00, 0x00 // Seta para Direita (8)
rhisis 1:ac6e904944c3 131 };
rhisis 1:ac6e904944c3 132
kaiquedog 0:bf743d54917c 133 CMD(0x40);
kaiquedog 0:bf743d54917c 134 for (int i = 0; i < 7*8; i++){
kaiquedog 0:bf743d54917c 135 WRI(new_chars[i]);
kaiquedog 0:bf743d54917c 136 }
kaiquedog 0:bf743d54917c 137 CMD(0x80);
kaiquedog 0:bf743d54917c 138
kaiquedog 0:bf743d54917c 139 }
kaiquedog 0:bf743d54917c 140
kaiquedog 0:bf743d54917c 141
kaiquedog 0:bf743d54917c 142
kaiquedog 0:bf743d54917c 143
kaiquedog 0:bf743d54917c 144 /*
kaiquedog 0:bf743d54917c 145 **********************
kaiquedog 0:bf743d54917c 146 ***** FUNÇÃO CLC *****
kaiquedog 0:bf743d54917c 147 **********************
kaiquedog 0:bf743d54917c 148 */
kaiquedog 0:bf743d54917c 149
kaiquedog 0:bf743d54917c 150 void LCD::clc(void){
kaiquedog 0:bf743d54917c 151 CMD(0x01);
kaiquedog 0:bf743d54917c 152 wait(0.002);
kaiquedog 0:bf743d54917c 153 _coluna = 1;
kaiquedog 0:bf743d54917c 154 _linha = 1;
kaiquedog 0:bf743d54917c 155 }
kaiquedog 0:bf743d54917c 156
kaiquedog 0:bf743d54917c 157
kaiquedog 0:bf743d54917c 158 /*
kaiquedog 0:bf743d54917c 159 ***********************
kaiquedog 0:bf743d54917c 160 ***** FUNÇÃO HOME *****
kaiquedog 0:bf743d54917c 161 ***********************
kaiquedog 0:bf743d54917c 162 */
kaiquedog 0:bf743d54917c 163 void LCD::home(void){
kaiquedog 0:bf743d54917c 164 wait(0.002);
kaiquedog 0:bf743d54917c 165
kaiquedog 0:bf743d54917c 166 dados = 0x0;
kaiquedog 0:bf743d54917c 167 bate_enable();
kaiquedog 0:bf743d54917c 168 dados = 0x2;
kaiquedog 0:bf743d54917c 169 bate_enable();
kaiquedog 0:bf743d54917c 170
kaiquedog 0:bf743d54917c 171 wait(0.002);
kaiquedog 0:bf743d54917c 172
kaiquedog 0:bf743d54917c 173 _coluna = 1;
kaiquedog 0:bf743d54917c 174 _linha = 1;
kaiquedog 0:bf743d54917c 175 }
kaiquedog 0:bf743d54917c 176
kaiquedog 0:bf743d54917c 177
kaiquedog 0:bf743d54917c 178 /*
kaiquedog 0:bf743d54917c 179 **************************
kaiquedog 0:bf743d54917c 180 ***** FUNÇÃO DIREITA *****
kaiquedog 0:bf743d54917c 181 **************************
kaiquedog 0:bf743d54917c 182 */
kaiquedog 0:bf743d54917c 183
kaiquedog 0:bf743d54917c 184 void LCD::direita(void){
kaiquedog 0:bf743d54917c 185 wait(0.0002);
kaiquedog 0:bf743d54917c 186
kaiquedog 0:bf743d54917c 187 dados = 0x1;
kaiquedog 0:bf743d54917c 188 bate_enable();
kaiquedog 0:bf743d54917c 189 dados = 0x4;
kaiquedog 0:bf743d54917c 190 bate_enable();
kaiquedog 0:bf743d54917c 191
kaiquedog 0:bf743d54917c 192 wait(0.0002);
kaiquedog 0:bf743d54917c 193
kaiquedog 0:bf743d54917c 194 _coluna = _coluna+1;
kaiquedog 0:bf743d54917c 195
kaiquedog 0:bf743d54917c 196 fim_de_curso();
kaiquedog 0:bf743d54917c 197 }
kaiquedog 0:bf743d54917c 198
kaiquedog 0:bf743d54917c 199
kaiquedog 0:bf743d54917c 200 /*
kaiquedog 0:bf743d54917c 201 ***************************
kaiquedog 0:bf743d54917c 202 ***** FUNÇÃO ESQUERDA *****
kaiquedog 0:bf743d54917c 203 ***************************
kaiquedog 0:bf743d54917c 204 */
kaiquedog 0:bf743d54917c 205
kaiquedog 0:bf743d54917c 206 void LCD::esquerda(void){
kaiquedog 0:bf743d54917c 207 wait(0.0002);
kaiquedog 0:bf743d54917c 208
kaiquedog 0:bf743d54917c 209 dados = 0x1;
kaiquedog 0:bf743d54917c 210 bate_enable();
kaiquedog 0:bf743d54917c 211 dados = 0x0;
kaiquedog 0:bf743d54917c 212 bate_enable();
kaiquedog 0:bf743d54917c 213
kaiquedog 0:bf743d54917c 214 wait(0.0002);
kaiquedog 0:bf743d54917c 215
kaiquedog 0:bf743d54917c 216 _coluna = _coluna - 1;
kaiquedog 0:bf743d54917c 217
kaiquedog 0:bf743d54917c 218 fim_de_curso();
kaiquedog 0:bf743d54917c 219 }
kaiquedog 0:bf743d54917c 220
kaiquedog 0:bf743d54917c 221
kaiquedog 0:bf743d54917c 222 /*
kaiquedog 0:bf743d54917c 223 ************************
kaiquedog 0:bf743d54917c 224 ***** FUNÇÃO APAGA *****
kaiquedog 0:bf743d54917c 225 ************************
kaiquedog 0:bf743d54917c 226 */
kaiquedog 0:bf743d54917c 227
kaiquedog 0:bf743d54917c 228 void LCD::apaga(void){
kaiquedog 0:bf743d54917c 229 RS = 1;
kaiquedog 0:bf743d54917c 230
kaiquedog 0:bf743d54917c 231 wait(0.002);
kaiquedog 0:bf743d54917c 232
kaiquedog 0:bf743d54917c 233 dados = 0x2;
kaiquedog 0:bf743d54917c 234 bate_enable();
kaiquedog 0:bf743d54917c 235 dados = 0x0;
kaiquedog 0:bf743d54917c 236 bate_enable();
kaiquedog 0:bf743d54917c 237
kaiquedog 0:bf743d54917c 238 RS = 0;
kaiquedog 0:bf743d54917c 239
kaiquedog 0:bf743d54917c 240 pos(_linha,_coluna);
kaiquedog 0:bf743d54917c 241 }
kaiquedog 0:bf743d54917c 242
kaiquedog 0:bf743d54917c 243
kaiquedog 0:bf743d54917c 244 /*
kaiquedog 0:bf743d54917c 245 ***********************
kaiquedog 0:bf743d54917c 246 ***** FUNÇÃO CMIA *****
kaiquedog 0:bf743d54917c 247 ***********************
kaiquedog 0:bf743d54917c 248 */
kaiquedog 0:bf743d54917c 249
kaiquedog 0:bf743d54917c 250 void LCD::cima(void){
kaiquedog 0:bf743d54917c 251 pos(1,_coluna);
kaiquedog 0:bf743d54917c 252
kaiquedog 0:bf743d54917c 253 _linha = 1;
kaiquedog 0:bf743d54917c 254 }
kaiquedog 0:bf743d54917c 255
kaiquedog 0:bf743d54917c 256
kaiquedog 0:bf743d54917c 257 /*
kaiquedog 0:bf743d54917c 258 ************************
kaiquedog 0:bf743d54917c 259 ***** FUNÇÃO BAIXO *****
kaiquedog 0:bf743d54917c 260 ************************
kaiquedog 0:bf743d54917c 261 */
kaiquedog 0:bf743d54917c 262
kaiquedog 0:bf743d54917c 263 void LCD::baixo(void){
kaiquedog 0:bf743d54917c 264 pos(2,_coluna);
kaiquedog 0:bf743d54917c 265
kaiquedog 0:bf743d54917c 266 _linha = 2;
kaiquedog 0:bf743d54917c 267 }
kaiquedog 0:bf743d54917c 268
kaiquedog 0:bf743d54917c 269
kaiquedog 0:bf743d54917c 270 //
kaiquedog 0:bf743d54917c 271
kaiquedog 0:bf743d54917c 272 /*
kaiquedog 0:bf743d54917c 273 **********************
kaiquedog 0:bf743d54917c 274 ***** FUNÇÃO POS *****
kaiquedog 0:bf743d54917c 275 **********************
kaiquedog 0:bf743d54917c 276 */
kaiquedog 0:bf743d54917c 277 void LCD::pos(int li, int co){
kaiquedog 0:bf743d54917c 278 int POSI = 0x80 + ((li-1) * 0x40) + (co-1);
kaiquedog 0:bf743d54917c 279
kaiquedog 0:bf743d54917c 280 CMD(POSI);
kaiquedog 0:bf743d54917c 281
kaiquedog 0:bf743d54917c 282 _coluna = co;
kaiquedog 0:bf743d54917c 283 _linha = li;
kaiquedog 0:bf743d54917c 284 }
kaiquedog 0:bf743d54917c 285
kaiquedog 0:bf743d54917c 286
kaiquedog 0:bf743d54917c 287
kaiquedog 0:bf743d54917c 288
kaiquedog 0:bf743d54917c 289 /*
kaiquedog 0:bf743d54917c 290 ***********************
kaiquedog 0:bf743d54917c 291 ***** FUNÇÃO PUTC *****
kaiquedog 0:bf743d54917c 292 ***********************
kaiquedog 0:bf743d54917c 293 */
kaiquedog 0:bf743d54917c 294
kaiquedog 0:bf743d54917c 295
kaiquedog 0:bf743d54917c 296
kaiquedog 0:bf743d54917c 297 int LCD::_putc(int value) {
kaiquedog 0:bf743d54917c 298 if (value == '\n') {
kaiquedog 0:bf743d54917c 299 baixo();
kaiquedog 0:bf743d54917c 300 }
kaiquedog 0:bf743d54917c 301 if(value == '~'){
kaiquedog 0:bf743d54917c 302 WRI(0x00);
kaiquedog 0:bf743d54917c 303 WRI(0x01);
kaiquedog 0:bf743d54917c 304 WRI(0x02);
kaiquedog 0:bf743d54917c 305 WRI(0x03);
kaiquedog 0:bf743d54917c 306 WRI(0x04);
kaiquedog 0:bf743d54917c 307 }
kaiquedog 0:bf743d54917c 308 else{
kaiquedog 0:bf743d54917c 309 RS = 1;
kaiquedog 0:bf743d54917c 310 dados = value>>4;
kaiquedog 0:bf743d54917c 311 bate_enable();
kaiquedog 0:bf743d54917c 312 dados = value;
kaiquedog 0:bf743d54917c 313 bate_enable();
kaiquedog 0:bf743d54917c 314 RS = 0;
kaiquedog 0:bf743d54917c 315 }
kaiquedog 0:bf743d54917c 316 _chars[_linha-1][_coluna-1] = value;
kaiquedog 0:bf743d54917c 317 _coluna++;
kaiquedog 0:bf743d54917c 318 fim_de_curso();
kaiquedog 0:bf743d54917c 319
kaiquedog 0:bf743d54917c 320 return value;
kaiquedog 0:bf743d54917c 321 }
kaiquedog 0:bf743d54917c 322
kaiquedog 0:bf743d54917c 323 int LCD::_getc() {
kaiquedog 0:bf743d54917c 324 return -1;
kaiquedog 0:bf743d54917c 325 }
kaiquedog 0:bf743d54917c 326
kaiquedog 0:bf743d54917c 327
kaiquedog 0:bf743d54917c 328 void LCD::putc(int value){
kaiquedog 0:bf743d54917c 329 RS = 1;
kaiquedog 0:bf743d54917c 330 dados = value>>4;
kaiquedog 0:bf743d54917c 331 bate_enable();
kaiquedog 0:bf743d54917c 332 dados = value;
kaiquedog 0:bf743d54917c 333 bate_enable();
kaiquedog 0:bf743d54917c 334 _coluna++;
kaiquedog 0:bf743d54917c 335 fim_de_curso();
kaiquedog 0:bf743d54917c 336 }
kaiquedog 0:bf743d54917c 337
kaiquedog 0:bf743d54917c 338
kaiquedog 0:bf743d54917c 339
kaiquedog 0:bf743d54917c 340 void LCD::Clock(int li, int co){
kaiquedog 0:bf743d54917c 341 int relogio[8][8] = {0x00,0x0e,0x15,0x17,0x11,0x0e,0x00,0x00,
kaiquedog 0:bf743d54917c 342 0x00,0x0e,0x15,0x15,0x13,0x0e,0x00,0x00,
kaiquedog 0:bf743d54917c 343 0x00,0x0e,0x15,0x15,0x15,0x0e,0x00,0x00,
kaiquedog 0:bf743d54917c 344 0x00,0x0e,0x15,0x15,0x19,0x0e,0x00,0x00,
kaiquedog 0:bf743d54917c 345 0x00,0x0e,0x15,0x1d,0x11,0x0e,0x00,0x00,
kaiquedog 0:bf743d54917c 346 0x00,0x0e,0x1d,0x15,0x11,0x0e,0x00,0x00,
kaiquedog 0:bf743d54917c 347 0x00,0x0e,0x15,0x15,0x11,0x0e,0x00,0x00,
kaiquedog 0:bf743d54917c 348 0x00,0x0e,0x17,0x15,0x11,0x0e,0x00,0x00
kaiquedog 0:bf743d54917c 349 };
kaiquedog 0:bf743d54917c 350
kaiquedog 0:bf743d54917c 351 for (int i = 0; i < 8; i++){
kaiquedog 0:bf743d54917c 352 CMD(0x40);
kaiquedog 0:bf743d54917c 353 for (int j = 0; j < 8; j++){
kaiquedog 0:bf743d54917c 354 WRI(relogio[i][j]);
kaiquedog 0:bf743d54917c 355 }
kaiquedog 0:bf743d54917c 356 pos(li,co);
kaiquedog 0:bf743d54917c 357 wait(1);
kaiquedog 0:bf743d54917c 358 WRI(0x00);
kaiquedog 0:bf743d54917c 359
kaiquedog 0:bf743d54917c 360 }
kaiquedog 0:bf743d54917c 361
kaiquedog 0:bf743d54917c 362
kaiquedog 0:bf743d54917c 363 }
kaiquedog 0:bf743d54917c 364
kaiquedog 0:bf743d54917c 365
kaiquedog 0:bf743d54917c 366 /*
kaiquedog 0:bf743d54917c 367 ************************
kaiquedog 0:bf743d54917c 368 ***** FUNÇÃO LEPOS *****
kaiquedog 0:bf743d54917c 369 ************************
kaiquedog 0:bf743d54917c 370 */
kaiquedog 0:bf743d54917c 371
kaiquedog 0:bf743d54917c 372
kaiquedog 0:bf743d54917c 373 string LCD::Lepos(void){
kaiquedog 0:bf743d54917c 374 string buffer;
kaiquedog 0:bf743d54917c 375 char li[6];
kaiquedog 0:bf743d54917c 376 sprintf(li,"(%d,%d)", _linha, _coluna);
kaiquedog 0:bf743d54917c 377 buffer.append(li);
kaiquedog 0:bf743d54917c 378 return buffer;
kaiquedog 0:bf743d54917c 379
kaiquedog 0:bf743d54917c 380 }
kaiquedog 0:bf743d54917c 381
kaiquedog 0:bf743d54917c 382