Projeto Mecatrônico
/
ProjetoMecatronico
testando
funcoes_ihm.cpp
- Committer:
- amandarm
- Date:
- 2020-05-28
- Revision:
- 47:0d9c10a9f87d
- Parent:
- 32:2a9b30e1e7ab
- Child:
- 49:4625aaa408fc
File content as of revision 47:0d9c10a9f87d:
//local para inclusao de bibliotecas #include "mbed.h" #include "TextLCD.h" #include "funcoes_ihm.h" TextLCD lcd(D4, D5, D6, D7, D8, D9); //funcoes para as telas da IHM void funcao_inicio(){ lcd.cls(); lcd.printf("1-Novo programa"); lcd.locate(0,1); lcd.printf("2-Usar programa salvo"); lcd.locate(0,2); } void funcao_tela_zera(){ lcd.cls(); lcd.printf("Zeramento:"); lcd.locate(0,1); lcd.printf("Confira se nao ha"); lcd.locate(0,2); lcd.printf("objetos sobre a mesa"); lcd.locate(0,3); lcd.printf("A-Proximo B-Voltar"); } void funcao_pega1(){ lcd.cls(); lcd.printf("Configuracao de pega"); lcd.locate(0,1); lcd.printf("1-Forma do pega"); lcd.locate(0,2); lcd.printf("2-Volume do pega"); lcd.locate(0,3); lcd.printf(" B-Voltar"); } void funcao_pega2(){ lcd.cls(); lcd.printf("Configuracao de pega"); lcd.locate(0,1); lcd.printf("3-Posicao do pega"); lcd.locate(0,2); lcd.printf(""); lcd.locate(0,3); lcd.printf(" B-Voltar"); } void funcao_pega_forma(){ lcd.cls(); lcd.printf("Forma do pega"); lcd.locate(0,1); lcd.printf("1 - Quadrado"); lcd.locate(0,2); lcd.printf("2 - Circular"); lcd.locate(0,3); lcd.printf(" B-Voltar"); } void funcao_pega_volume(){ lcd.cls(); lcd.printf("Insira o volume"); lcd.locate(0,1); lcd.printf("Em ml:"); lcd.locate(0,2); lcd.printf(""); lcd.locate(0,3); lcd.printf("A-Proximo B-Voltar"); } void funcao_pega_forma_quad(){ lcd.cls(); lcd.printf("Dimensoes do pega"); lcd.locate(0,1); lcd.printf("Comprimento em mm"); lcd.locate(0,2); lcd.printf(""); lcd.locate(0,3); lcd.printf("A-Proximo B-Voltar"); } void funcao_pega_forma_red(){ lcd.cls(); lcd.printf("Dimensoes do pega"); lcd.locate(0,1); lcd.printf("Diamentro em mm"); lcd.locate(0,2); lcd.printf(""); lcd.locate(0,3); lcd.printf("A-Proximo B-Voltar"); } void funcao_pega_pos_x(){ //desativar os botoes de Y lcd.cls(); lcd.printf("Posicione pega em X"); lcd.locate(0,1); lcd.printf("Use botoes ate chegar"); lcd.locate(0,2); lcd.printf("na posicao desejada"); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_pega_pos_y(){ //desativar os botoes de X lcd.cls(); lcd.printf("Posicione pega em Y"); lcd.locate(0,1); lcd.printf("Use botoes ate chegar"); lcd.locate(0,2); lcd.printf("na posicao desejada"); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_solta1(){ lcd.cls(); lcd.printf("Configuracao solta"); lcd.locate(0,1); lcd.printf("1-Dimensao solta"); lcd.locate(0,2); lcd.printf("2-Volume da solta"); lcd.locate(0,3); lcd.printf(" B-Voltar"); } void funcao_solta2(){ lcd.cls(); lcd.printf("Configuracao solta"); lcd.locate(0,1); lcd.printf("3-Posicao solta"); lcd.locate(0,2); lcd.printf(""); lcd.locate(0,3); lcd.printf(" B-Voltar"); } void funcao_solta_dimensao(){ lcd.cls(); lcd.printf("Insira o diametro"); lcd.locate(0,1); lcd.printf("de solta, em mm:"); lcd.locate(0,2); lcd.printf(""); lcd.printf(0,3); lcd.printf("A-Proximo B-Voltar"); } void funcao_solta_vol(){ lcd.cls(); lcd.printf("Determinar volume"); lcd.locate(0,1); lcd.printf("1-Todos mesmo volume"); lcd.locate(0,2); lcd.printf("2-Pino a pino"); lcd.locate(0,3); lcd.printf("A-Proximo B-Voltar"); } void funcao_solta_vol_igual(){ lcd.cls(); lcd.printf("Insira o volume"); lcd.locate(0,1); lcd.printf("em ml:"); lcd.locate(0,2); lcd.printf(""); lcd.locate(0,3); lcd.printf("A-Proximo B-Voltar"); } void funcao_solta_vol_cada(){ lcd.cls(); lcd.printf("Selecao: * * * "); lcd.locate(0,1); lcd.printf("Volume: * * * "); lcd.locate(0,2); lcd.printf("A-Confirma * * * "); lcd.locate(0,3); lcd.printf("B-Corrigir C-Proximo"); } void funcao_solta_pos_x(){ //desativar os botoes de Y lcd.cls(); lcd.printf("Posicione pega em X"); lcd.locate(0,1); lcd.printf("Use botoes ate chegar"); lcd.locate(0,2); lcd.printf("na posicao desejada"); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_solta_pos_y(){ //desativar os botoes de X lcd.cls(); lcd.printf("Posicione pega em Y"); lcd.locate(0,1); lcd.printf("Use botoes ate chegar"); lcd.locate(0,2); lcd.printf("na posicao desejada"); lcd.printf(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_confirma(){ lcd.cls(); lcd.printf("Revisao Parametros"); lcd.locate(0,1); lcd.printf("1-Pega:"); lcd.locate(0,2); lcd.printf("2-Pinos solta:"); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_nome_prog(){ lcd.cls(); lcd.printf("Nome do programa"); lcd.locate(0,1); lcd.printf("Insira um codigo"); lcd.locate(0,2); lcd.printf("para seu programa:"); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_acomp(){ //colocar os valores adequados na tela lcd.cls(); lcd.printf("Prog em execucao"); lcd.locate(0,1); lcd.printf("Tempo: xx min yy s"); lcd.locate(0,2); lcd.printf("Progresso: zz%"); lcd.locate(0,3); lcd.printf("A-Pausar"); } void funcao_pausa(){ lcd.cls(); lcd.printf("Prog pausado"); lcd.locate(0,1); lcd.printf("Progresso: zz%"); lcd.locate(0,2); lcd.printf(""); lcd.locate(0,3); lcd.printf("A-Continuar B-Parar"); } void funcao_salvo1(){ lcd.cls(); lcd.printf("1-xx"); lcd.locate(0,1); lcd.printf("2-yy"); lcd.locate(0,2); lcd.printf("3-zz"); lcd.locate(0,3); lcd.printf(" B-Anterior"); } void funcao_salvo2(){ lcd.cls(); lcd.printf("4-xx"); lcd.locate(0,1); lcd.printf("5-yy"); lcd.locate(0,2); lcd.printf("6-zz"); lcd.locate(0,3); lcd.printf("A-Proxima B-Anterior"); } void funcao_salvo_agree1(){ lcd.cls(); lcd.printf("Confirmar programa"); lcd.locate(0,1); lcd.printf("1-Posicao pega"); lcd.locate(0,2); lcd.printf("2-Posicao solta"); lcd.locate(0,3); lcd.printf(" B-Voltar"); } void funcao_salvo_agree2(){ lcd.cls(); lcd.printf("Confirmar programa"); lcd.locate(0,1); lcd.printf("3-Volume pega"); lcd.locate(0,2); lcd.printf("4-Volume solta"); lcd.locate(0,3); lcd.printf(" B-Voltar"); } void funcao_salvo_agree_pos_aviso(){ lcd.cls(); lcd.printf("A pipeta iro na pega"); lcd.locate(0,1); lcd.printf("Certifique-se que nao"); lcd.locate(0,2); lcd.printf("ho objetos na mesa"); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_salvo_agree_pos_certo(){ lcd.cls(); lcd.printf("Posicao correta?"); lcd.locate(0,1); lcd.printf("1-Sim"); lcd.locate(0,2); lcd.printf("2-Ajustar"); lcd.locate(0,3); lcd.printf(" B-Voltar"); } void funcao_salvo_agree_solta_aviso(){ lcd.cls(); lcd.printf("A pipeta ira na solta"); lcd.locate(0,1); lcd.printf("Certifique-se que nao"); lcd.locate(0,2); lcd.printf("ha objetos na mesa"); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_salvo_agree_pega_vol(){ lcd.cls(); lcd.printf("Insira o volume pega"); lcd.locate(0,1); lcd.printf("Em ml:"); lcd.locate(0,2); lcd.printf(""); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); } void funcao_salvo_agree_solta_vol(){ lcd.cls(); lcd.printf("1-x 2-y 3-z"); lcd.locate(0,1); lcd.printf("4-x 5-y 6-z"); lcd.locate(0,2); lcd.printf("7-x 8-y 9-z"); lcd.locate(0,3); lcd.printf("A-Confirma B-Voltar"); }