Código para o menu no LCD
Dependencies: mbed SDFileSystemSD TextLCD
Fork of TextLCD_HelloWorld2 by
main.cpp@7:e2c1b0338286, 2018-05-10 (annotated)
- Committer:
- claraluques
- Date:
- Thu May 10 21:15:33 2018 +0000
- Revision:
- 7:e2c1b0338286
- Parent:
- 6:24cbbdf2dac2
- Child:
- 8:b80f50544ddd
TELA JOG PRONTA, CURSOS N?O MOVE;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wim | 0:a75049de1a82 | 1 | #include "mbed.h" |
wim | 0:a75049de1a82 | 2 | #include "TextLCD.h" |
claraluques | 5:30f5ffe0ea0b | 3 | /* |
claraluques | 5:30f5ffe0ea0b | 4 | // Host PC Communication channels |
claraluques | 5:30f5ffe0ea0b | 5 | Serial pc(USBTX, USBRX); // tx, rx |
wim | 4:a3e4bb2053cb | 6 | |
claraluques | 5:30f5ffe0ea0b | 7 | //I2C Communication |
claraluques | 5:30f5ffe0ea0b | 8 | I2C i2c_lcd(D14,D15); // SDA, SCL |
claraluques | 5:30f5ffe0ea0b | 9 | |
claraluques | 5:30f5ffe0ea0b | 10 | //Botão push |
claraluques | 5:30f5ffe0ea0b | 11 | InterruptIn botao(D7); |
claraluques | 5:30f5ffe0ea0b | 12 | |
claraluques | 5:30f5ffe0ea0b | 13 | //LCD instantiation |
claraluques | 5:30f5ffe0ea0b | 14 | TextLCD_I2C lcd(&i2c_lcd, 0x7E, TextLCD::LCD20x4); // I2C exp: I2C bus, PCF8574 Slaveaddress, LCD Type |
claraluques | 5:30f5ffe0ea0b | 15 | |
claraluques | 5:30f5ffe0ea0b | 16 | //variáveis int |
claraluques | 5:30f5ffe0ea0b | 17 | int colunas = lcd.columns(); |
claraluques | 5:30f5ffe0ea0b | 18 | int linhas = lcd.rows(); |
claraluques | 5:30f5ffe0ea0b | 19 | int c1 = 510000000; |
claraluques | 5:30f5ffe0ea0b | 20 | int pontosl = 10; |
claraluques | 5:30f5ffe0ea0b | 21 | int botpres; |
claraluques | 5:30f5ffe0ea0b | 22 | |
claraluques | 5:30f5ffe0ea0b | 23 | //variáveis float |
claraluques | 5:30f5ffe0ea0b | 24 | float coordx = 123; |
claraluques | 5:30f5ffe0ea0b | 25 | float coardy = 456; |
claraluques | 5:30f5ffe0ea0b | 26 | float coardz = 789; |
claraluques | 5:30f5ffe0ea0b | 27 | |
claraluques | 5:30f5ffe0ea0b | 28 | //funções |
claraluques | 5:30f5ffe0ea0b | 29 | void botao_press(void); |
claraluques | 5:30f5ffe0ea0b | 30 | void botao_solto(void); |
claraluques | 5:30f5ffe0ea0b | 31 | |
claraluques | 5:30f5ffe0ea0b | 32 | int main() { |
claraluques | 5:30f5ffe0ea0b | 33 | lcd.setBacklight(TextLCD::LightOn); //liga backlight |
claraluques | 5:30f5ffe0ea0b | 34 | lcd.cls(); |
claraluques | 5:30f5ffe0ea0b | 35 | lcd.printf("Certifique-se de que voce esta seguro para comecar"); |
claraluques | 5:30f5ffe0ea0b | 36 | |
claraluques | 5:30f5ffe0ea0b | 37 | botao.rise(&botao_press); |
claraluques | 5:30f5ffe0ea0b | 38 | botao.fall(&botao_solto); |
claraluques | 5:30f5ffe0ea0b | 39 | wait(2); |
claraluques | 5:30f5ffe0ea0b | 40 | |
claraluques | 5:30f5ffe0ea0b | 41 | while(1){ |
claraluques | 5:30f5ffe0ea0b | 42 | while(1) { |
claraluques | 5:30f5ffe0ea0b | 43 | |
claraluques | 5:30f5ffe0ea0b | 44 | |
claraluques | 5:30f5ffe0ea0b | 45 | if (c1>500000000) { |
claraluques | 5:30f5ffe0ea0b | 46 | lcd.cls(); |
claraluques | 5:30f5ffe0ea0b | 47 | lcd.printf("FUNCAO JOG"); |
claraluques | 5:30f5ffe0ea0b | 48 | lcd.locate(0,1); |
claraluques | 5:30f5ffe0ea0b | 49 | //lcd.printf("X: %.1f Y: %d.1 Z: %d.1", coordx, coordy, coordz); |
claraluques | 5:30f5ffe0ea0b | 50 | lcd.locate(0,2); |
claraluques | 5:30f5ffe0ea0b | 51 | lcd.printf("Aperte > ok p/ salvar o ponto %c", 0x3E); |
claraluques | 5:30f5ffe0ea0b | 52 | //wait(0.5) |
claraluques | 5:30f5ffe0ea0b | 53 | //lcd.printf("Aperte ok p/ salvar o ponto %c", 0xff); |
claraluques | 5:30f5ffe0ea0b | 54 | InterruptIn botao(D7); |
claraluques | 5:30f5ffe0ea0b | 55 | c1 = 0; |
claraluques | 5:30f5ffe0ea0b | 56 | } |
claraluques | 5:30f5ffe0ea0b | 57 | |
claraluques | 5:30f5ffe0ea0b | 58 | c1++; |
claraluques | 5:30f5ffe0ea0b | 59 | |
claraluques | 5:30f5ffe0ea0b | 60 | if(botpres) { //se pressionado, aparece a tela de ponto salvo com contagem de pontos restantes |
claraluques | 5:30f5ffe0ea0b | 61 | lcd.cls(); |
claraluques | 5:30f5ffe0ea0b | 62 | lcd.locate(0,0); |
claraluques | 5:30f5ffe0ea0b | 63 | lcd.printf("Voce salvou um ponto"); |
claraluques | 5:30f5ffe0ea0b | 64 | lcd.locate(0,2); |
claraluques | 5:30f5ffe0ea0b | 65 | pontosl--; |
claraluques | 5:30f5ffe0ea0b | 66 | lcd.printf("Pontos livres: %d",pontosl); |
claraluques | 5:30f5ffe0ea0b | 67 | wait(2); |
claraluques | 5:30f5ffe0ea0b | 68 | c1=510000000; |
claraluques | 5:30f5ffe0ea0b | 69 | break; |
claraluques | 5:30f5ffe0ea0b | 70 | } |
claraluques | 5:30f5ffe0ea0b | 71 | } |
claraluques | 5:30f5ffe0ea0b | 72 | } |
claraluques | 5:30f5ffe0ea0b | 73 | } |
claraluques | 5:30f5ffe0ea0b | 74 | |
claraluques | 5:30f5ffe0ea0b | 75 | void botao_press(void){ |
claraluques | 5:30f5ffe0ea0b | 76 | botpres = 1; |
claraluques | 5:30f5ffe0ea0b | 77 | printf("pressionado\n\r"); |
claraluques | 5:30f5ffe0ea0b | 78 | } |
claraluques | 5:30f5ffe0ea0b | 79 | void botao_solto(void) { |
claraluques | 5:30f5ffe0ea0b | 80 | botpres = 0; |
claraluques | 5:30f5ffe0ea0b | 81 | printf("solto\n\r"); |
claraluques | 5:30f5ffe0ea0b | 82 | } |
claraluques | 5:30f5ffe0ea0b | 83 | */ |
claraluques | 5:30f5ffe0ea0b | 84 | |
claraluques | 5:30f5ffe0ea0b | 85 | //#include mbed.h |
claraluques | 5:30f5ffe0ea0b | 86 | //#include "TextLCD.h" |
claraluques | 5:30f5ffe0ea0b | 87 | |
wim | 0:a75049de1a82 | 88 | // Host PC Communication channels |
wim | 0:a75049de1a82 | 89 | Serial pc(USBTX, USBRX); // tx, rx |
wim | 4:a3e4bb2053cb | 90 | |
claraluques | 5:30f5ffe0ea0b | 91 | //I2C Communication |
claraluques | 5:30f5ffe0ea0b | 92 | I2C i2c_lcd(D14,D15); // SDA, SCL |
claraluques | 5:30f5ffe0ea0b | 93 | |
claraluques | 5:30f5ffe0ea0b | 94 | //Botão push |
claraluques | 5:30f5ffe0ea0b | 95 | InterruptIn botao_enter(D13); |
claraluques | 5:30f5ffe0ea0b | 96 | InterruptIn botao_cima(D10); |
claraluques | 5:30f5ffe0ea0b | 97 | InterruptIn botao_baixo(D9); |
claraluques | 5:30f5ffe0ea0b | 98 | |
claraluques | 5:30f5ffe0ea0b | 99 | //LCD instantiation |
claraluques | 5:30f5ffe0ea0b | 100 | TextLCD_I2C lcd(&i2c_lcd, 0x7E, TextLCD::LCD20x4); // I2C exp: I2C bus, PCF8574 Slaveaddress, LCD Type |
claraluques | 5:30f5ffe0ea0b | 101 | |
claraluques | 5:30f5ffe0ea0b | 102 | //variáveis int |
claraluques | 5:30f5ffe0ea0b | 103 | //int max = 3; |
claraluques | 5:30f5ffe0ea0b | 104 | //int min = 0; |
claraluques | 5:30f5ffe0ea0b | 105 | int bot_enter; |
claraluques | 5:30f5ffe0ea0b | 106 | int bot_cima; |
claraluques | 5:30f5ffe0ea0b | 107 | int bot_baixo; |
claraluques | 6:24cbbdf2dac2 | 108 | int penter = 0; |
claraluques | 6:24cbbdf2dac2 | 109 | int pcima = 0; |
claraluques | 6:24cbbdf2dac2 | 110 | int pbaixo = 0; |
wim | 0:a75049de1a82 | 111 | |
claraluques | 5:30f5ffe0ea0b | 112 | //variáveis float |
claraluques | 7:e2c1b0338286 | 113 | float cx = 120.458; |
claraluques | 7:e2c1b0338286 | 114 | float cy = 457.854; |
claraluques | 7:e2c1b0338286 | 115 | float cz = 782.659; |
claraluques | 5:30f5ffe0ea0b | 116 | |
claraluques | 5:30f5ffe0ea0b | 117 | //funções interrupt |
claraluques | 5:30f5ffe0ea0b | 118 | void botenter_press(void); |
claraluques | 5:30f5ffe0ea0b | 119 | void botenter_solto(void); |
wim | 0:a75049de1a82 | 120 | |
claraluques | 5:30f5ffe0ea0b | 121 | void botcima_press(void); |
claraluques | 5:30f5ffe0ea0b | 122 | void botcima_solto(void); |
claraluques | 5:30f5ffe0ea0b | 123 | |
claraluques | 5:30f5ffe0ea0b | 124 | void botbaixo_press(void); |
claraluques | 5:30f5ffe0ea0b | 125 | void botbaixo_solto(void); |
claraluques | 5:30f5ffe0ea0b | 126 | |
claraluques | 5:30f5ffe0ea0b | 127 | //criar classe "menu" (funções das telas) |
claraluques | 5:30f5ffe0ea0b | 128 | class Menu{ |
claraluques | 5:30f5ffe0ea0b | 129 | public: |
claraluques | 5:30f5ffe0ea0b | 130 | int linha; |
claraluques | 7:e2c1b0338286 | 131 | //int coluna; |
claraluques | 5:30f5ffe0ea0b | 132 | int func; |
wim | 4:a3e4bb2053cb | 133 | |
claraluques | 6:24cbbdf2dac2 | 134 | void movercursor(int min, int max, int col){ //função para mover cursor de seleção |
claraluques | 5:30f5ffe0ea0b | 135 | linha = min; |
claraluques | 7:e2c1b0338286 | 136 | lcd.locate(col,min); |
claraluques | 7:e2c1b0338286 | 137 | lcd.printf("%c", 0x3E); |
claraluques | 6:24cbbdf2dac2 | 138 | while (bot_enter==penter){ |
claraluques | 5:30f5ffe0ea0b | 139 | if (bot_cima==1){ |
claraluques | 5:30f5ffe0ea0b | 140 | if (linha==min){ |
claraluques | 6:24cbbdf2dac2 | 141 | lcd.locate(col,min); |
claraluques | 6:24cbbdf2dac2 | 142 | lcd.printf(" "); |
claraluques | 5:30f5ffe0ea0b | 143 | linha=max; |
claraluques | 6:24cbbdf2dac2 | 144 | lcd.locate(col, linha); |
claraluques | 6:24cbbdf2dac2 | 145 | lcd.printf("%c", 0x3E); |
claraluques | 5:30f5ffe0ea0b | 146 | } |
claraluques | 5:30f5ffe0ea0b | 147 | else { |
claraluques | 6:24cbbdf2dac2 | 148 | lcd.locate(col,linha); |
claraluques | 6:24cbbdf2dac2 | 149 | lcd.printf(" "); |
claraluques | 5:30f5ffe0ea0b | 150 | linha--; |
claraluques | 6:24cbbdf2dac2 | 151 | lcd.locate(col, linha); |
claraluques | 6:24cbbdf2dac2 | 152 | lcd.printf("%c", 0x3E); |
claraluques | 5:30f5ffe0ea0b | 153 | } |
claraluques | 6:24cbbdf2dac2 | 154 | bot_cima = 0; |
claraluques | 5:30f5ffe0ea0b | 155 | } |
claraluques | 5:30f5ffe0ea0b | 156 | if (bot_baixo==1){ |
claraluques | 5:30f5ffe0ea0b | 157 | if (linha==max){ |
claraluques | 6:24cbbdf2dac2 | 158 | lcd.locate(col,max); |
claraluques | 6:24cbbdf2dac2 | 159 | lcd.printf(" "); |
claraluques | 5:30f5ffe0ea0b | 160 | linha=min; |
claraluques | 6:24cbbdf2dac2 | 161 | lcd.locate(col, linha); |
claraluques | 6:24cbbdf2dac2 | 162 | lcd.printf("%c", 0x3E); |
claraluques | 5:30f5ffe0ea0b | 163 | } |
claraluques | 5:30f5ffe0ea0b | 164 | else { |
claraluques | 6:24cbbdf2dac2 | 165 | lcd.locate(col,linha); |
claraluques | 6:24cbbdf2dac2 | 166 | lcd.printf(" "); |
claraluques | 5:30f5ffe0ea0b | 167 | linha++; |
claraluques | 6:24cbbdf2dac2 | 168 | lcd.locate(col, linha); |
claraluques | 6:24cbbdf2dac2 | 169 | lcd.printf("%c", 0x3E); |
claraluques | 5:30f5ffe0ea0b | 170 | } |
claraluques | 6:24cbbdf2dac2 | 171 | bot_baixo = 0; |
claraluques | 5:30f5ffe0ea0b | 172 | } |
claraluques | 6:24cbbdf2dac2 | 173 | //lcd.locate(col, linha); |
claraluques | 6:24cbbdf2dac2 | 174 | //lcd.printf("%c", 0x3E); |
claraluques | 6:24cbbdf2dac2 | 175 | //printf("%d \n\r",linha); |
claraluques | 7:e2c1b0338286 | 176 | //printf("%d %d %d \n\r", bot_enter, bot_cima, bot_baixo); |
claraluques | 7:e2c1b0338286 | 177 | //wait_ms(500); |
claraluques | 5:30f5ffe0ea0b | 178 | } |
claraluques | 5:30f5ffe0ea0b | 179 | //printf("%d \n\r",linha); |
claraluques | 5:30f5ffe0ea0b | 180 | } |
claraluques | 5:30f5ffe0ea0b | 181 | |
claraluques | 5:30f5ffe0ea0b | 182 | |
claraluques | 5:30f5ffe0ea0b | 183 | //func 0 |
claraluques | 5:30f5ffe0ea0b | 184 | void inicializar(){ //função tela incial de boas-vindas |
claraluques | 5:30f5ffe0ea0b | 185 | lcd.cls(); |
claraluques | 5:30f5ffe0ea0b | 186 | lcd.locate(9,0); |
claraluques | 5:30f5ffe0ea0b | 187 | lcd.printf("Ola!"); |
claraluques | 5:30f5ffe0ea0b | 188 | lcd.locate(0,1); |
claraluques | 5:30f5ffe0ea0b | 189 | lcd.printf("Utilize seu EPI ao operar a maquina."); |
claraluques | 5:30f5ffe0ea0b | 190 | wait(5); |
claraluques | 5:30f5ffe0ea0b | 191 | func = 1; |
claraluques | 5:30f5ffe0ea0b | 192 | } |
claraluques | 5:30f5ffe0ea0b | 193 | |
claraluques | 5:30f5ffe0ea0b | 194 | //func 1 |
claraluques | 5:30f5ffe0ea0b | 195 | void menuprincipal(){ //função menu principal |
claraluques | 5:30f5ffe0ea0b | 196 | lcd.cls(); |
claraluques | 5:30f5ffe0ea0b | 197 | lcd.locate(1,0); |
claraluques | 5:30f5ffe0ea0b | 198 | lcd.printf("Modo JOG"); |
claraluques | 5:30f5ffe0ea0b | 199 | lcd.locate(1,1); |
claraluques | 5:30f5ffe0ea0b | 200 | lcd.printf("Modo Automatico"); |
claraluques | 5:30f5ffe0ea0b | 201 | lcd.locate(1,2); |
claraluques | 5:30f5ffe0ea0b | 202 | lcd.printf("Config"); |
claraluques | 6:24cbbdf2dac2 | 203 | movercursor(0,2,0); |
claraluques | 6:24cbbdf2dac2 | 204 | if (bot_enter!=penter){ |
claraluques | 5:30f5ffe0ea0b | 205 | if (linha==0){ |
claraluques | 5:30f5ffe0ea0b | 206 | func = 2; |
claraluques | 5:30f5ffe0ea0b | 207 | } |
claraluques | 5:30f5ffe0ea0b | 208 | else if (linha==1) { |
claraluques | 5:30f5ffe0ea0b | 209 | func = 3; |
claraluques | 5:30f5ffe0ea0b | 210 | } |
claraluques | 5:30f5ffe0ea0b | 211 | else if (linha==2) { |
claraluques | 5:30f5ffe0ea0b | 212 | func = 4; |
claraluques | 5:30f5ffe0ea0b | 213 | } |
claraluques | 5:30f5ffe0ea0b | 214 | } |
claraluques | 5:30f5ffe0ea0b | 215 | } |
claraluques | 6:24cbbdf2dac2 | 216 | |
claraluques | 6:24cbbdf2dac2 | 217 | |
claraluques | 6:24cbbdf2dac2 | 218 | //func 2 |
claraluques | 6:24cbbdf2dac2 | 219 | void jog(){ //função tela jog |
claraluques | 7:e2c1b0338286 | 220 | //penter = 0; |
claraluques | 6:24cbbdf2dac2 | 221 | lcd.cls(); |
claraluques | 7:e2c1b0338286 | 222 | lcd.locate(4,0); |
claraluques | 7:e2c1b0338286 | 223 | lcd.printf("Coordenadas:"); |
claraluques | 7:e2c1b0338286 | 224 | lcd.locate(0,1); |
claraluques | 7:e2c1b0338286 | 225 | lcd.printf("X:%.3f", cx); |
claraluques | 7:e2c1b0338286 | 226 | lcd.locate(0,2); |
claraluques | 7:e2c1b0338286 | 227 | lcd.printf("Y:%.3f", cy); |
claraluques | 7:e2c1b0338286 | 228 | lcd.locate(0,3); |
claraluques | 7:e2c1b0338286 | 229 | lcd.printf("Z:%.3f", cz); |
claraluques | 6:24cbbdf2dac2 | 230 | lcd.locate(11,1); |
claraluques | 6:24cbbdf2dac2 | 231 | lcd.printf("Salvar"); |
claraluques | 6:24cbbdf2dac2 | 232 | lcd.locate(11,2); |
claraluques | 6:24cbbdf2dac2 | 233 | lcd.printf("Concluir"); |
claraluques | 6:24cbbdf2dac2 | 234 | lcd.locate(11,3); |
claraluques | 6:24cbbdf2dac2 | 235 | lcd.printf("Cancelar"); |
claraluques | 7:e2c1b0338286 | 236 | movercursor(1,3,10); |
claraluques | 6:24cbbdf2dac2 | 237 | if (bot_enter!=penter){ |
claraluques | 6:24cbbdf2dac2 | 238 | if (linha==1){ |
claraluques | 6:24cbbdf2dac2 | 239 | func = 5; |
claraluques | 6:24cbbdf2dac2 | 240 | } |
claraluques | 6:24cbbdf2dac2 | 241 | else if (linha==2) { |
claraluques | 6:24cbbdf2dac2 | 242 | func = 6; |
claraluques | 6:24cbbdf2dac2 | 243 | } |
claraluques | 6:24cbbdf2dac2 | 244 | else if (linha==3) { |
claraluques | 6:24cbbdf2dac2 | 245 | func = 7; |
claraluques | 6:24cbbdf2dac2 | 246 | } |
claraluques | 6:24cbbdf2dac2 | 247 | } |
claraluques | 6:24cbbdf2dac2 | 248 | |
claraluques | 6:24cbbdf2dac2 | 249 | } |
claraluques | 6:24cbbdf2dac2 | 250 | |
claraluques | 6:24cbbdf2dac2 | 251 | |
claraluques | 5:30f5ffe0ea0b | 252 | Menu(); |
claraluques | 5:30f5ffe0ea0b | 253 | }; |
wim | 1:ef419b21167d | 254 | |
claraluques | 5:30f5ffe0ea0b | 255 | Menu::Menu(){ |
claraluques | 5:30f5ffe0ea0b | 256 | func = 0; |
wim | 4:a3e4bb2053cb | 257 | } |
wim | 3:f238b4f7874f | 258 | |
claraluques | 5:30f5ffe0ea0b | 259 | Menu menu; |
wim | 3:f238b4f7874f | 260 | |
claraluques | 5:30f5ffe0ea0b | 261 | int main () { |
claraluques | 5:30f5ffe0ea0b | 262 | lcd.setBacklight(TextLCD::LightOn); //liga backlight |
claraluques | 5:30f5ffe0ea0b | 263 | lcd.setCursor(TextLCD::CurOff_BlkOff); |
claraluques | 5:30f5ffe0ea0b | 264 | |
claraluques | 5:30f5ffe0ea0b | 265 | botao_enter.rise(&botenter_press); |
claraluques | 6:24cbbdf2dac2 | 266 | //botao_enter.fall(&botenter_solto); |
claraluques | 5:30f5ffe0ea0b | 267 | |
claraluques | 5:30f5ffe0ea0b | 268 | botao_cima.rise(&botcima_press); |
claraluques | 6:24cbbdf2dac2 | 269 | //botao_cima.fall(&botcima_solto); |
claraluques | 5:30f5ffe0ea0b | 270 | |
claraluques | 5:30f5ffe0ea0b | 271 | botao_baixo.rise(&botbaixo_press); |
claraluques | 6:24cbbdf2dac2 | 272 | //botao_baixo.fall(&botbaixo_solto); |
claraluques | 6:24cbbdf2dac2 | 273 | |
claraluques | 5:30f5ffe0ea0b | 274 | |
claraluques | 5:30f5ffe0ea0b | 275 | while(1){ |
claraluques | 5:30f5ffe0ea0b | 276 | //printf("%d %d %d \n\r", bot_enter, bot_cima, bot_baixo); |
claraluques | 5:30f5ffe0ea0b | 277 | switch(menu.func){ |
claraluques | 5:30f5ffe0ea0b | 278 | case 0: menu.inicializar(); break; |
claraluques | 5:30f5ffe0ea0b | 279 | case 1: menu.menuprincipal(); break; |
claraluques | 6:24cbbdf2dac2 | 280 | case 2: menu.jog(); break; |
claraluques | 5:30f5ffe0ea0b | 281 | //case 3: menu.notReferenced(2); break; |
claraluques | 5:30f5ffe0ea0b | 282 | //case 4: menu.notReferenced(3); break; |
claraluques | 5:30f5ffe0ea0b | 283 | //case 5: menu.referencing(); break; |
claraluques | 5:30f5ffe0ea0b | 284 | //case 6: menu.rootMenu(); break; |
claraluques | 5:30f5ffe0ea0b | 285 | //case 7: menu.manualControl(); break; |
claraluques | 5:30f5ffe0ea0b | 286 | //case 8: menu.positions(); break; |
claraluques | 5:30f5ffe0ea0b | 287 | //case 9: menu.selectPos(); break; |
claraluques | 5:30f5ffe0ea0b | 288 | //case 10: menu.selectPos(2); break; |
claraluques | 5:30f5ffe0ea0b | 289 | //case 11: menu.selectPos(3); break; |
claraluques | 5:30f5ffe0ea0b | 290 | //case 12: menu.run(); break; |
claraluques | 5:30f5ffe0ea0b | 291 | } |
claraluques | 5:30f5ffe0ea0b | 292 | } |
claraluques | 5:30f5ffe0ea0b | 293 | } |
claraluques | 5:30f5ffe0ea0b | 294 | |
claraluques | 5:30f5ffe0ea0b | 295 | |
claraluques | 5:30f5ffe0ea0b | 296 | |
claraluques | 5:30f5ffe0ea0b | 297 | |
claraluques | 5:30f5ffe0ea0b | 298 | |
claraluques | 5:30f5ffe0ea0b | 299 | |
claraluques | 5:30f5ffe0ea0b | 300 | //função interrupt botão enter |
claraluques | 5:30f5ffe0ea0b | 301 | |
claraluques | 5:30f5ffe0ea0b | 302 | void botenter_press(void){ |
claraluques | 6:24cbbdf2dac2 | 303 | penter = bot_enter; |
claraluques | 6:24cbbdf2dac2 | 304 | bot_enter = !bot_enter; |
claraluques | 5:30f5ffe0ea0b | 305 | printf("enter high"); |
claraluques | 5:30f5ffe0ea0b | 306 | } |
claraluques | 6:24cbbdf2dac2 | 307 | /*void botenter_solto(void) { |
claraluques | 6:24cbbdf2dac2 | 308 | penter = bot_enter; |
claraluques | 6:24cbbdf2dac2 | 309 | bot_enter = !bot_enter; |
claraluques | 5:30f5ffe0ea0b | 310 | printf("enter low"); |
claraluques | 6:24cbbdf2dac2 | 311 | }*/ |
claraluques | 5:30f5ffe0ea0b | 312 | |
claraluques | 5:30f5ffe0ea0b | 313 | //função interrupt botão cima |
claraluques | 5:30f5ffe0ea0b | 314 | |
claraluques | 5:30f5ffe0ea0b | 315 | void botcima_press(void){ |
claraluques | 6:24cbbdf2dac2 | 316 | pcima = bot_cima; |
claraluques | 6:24cbbdf2dac2 | 317 | bot_cima = !bot_cima; |
claraluques | 5:30f5ffe0ea0b | 318 | printf("cima high"); |
claraluques | 5:30f5ffe0ea0b | 319 | } |
claraluques | 6:24cbbdf2dac2 | 320 | /*void botcima_solto(void) { |
claraluques | 6:24cbbdf2dac2 | 321 | pcima = bot_cima; |
claraluques | 6:24cbbdf2dac2 | 322 | bot_cima = !bot_cima; |
claraluques | 5:30f5ffe0ea0b | 323 | printf("cima low"); |
claraluques | 6:24cbbdf2dac2 | 324 | }*/ |
wim | 0:a75049de1a82 | 325 | |
claraluques | 5:30f5ffe0ea0b | 326 | //função interrupt botão baixo |
claraluques | 5:30f5ffe0ea0b | 327 | |
claraluques | 5:30f5ffe0ea0b | 328 | void botbaixo_press(void){ |
claraluques | 6:24cbbdf2dac2 | 329 | pbaixo = bot_baixo; |
claraluques | 6:24cbbdf2dac2 | 330 | bot_baixo = !bot_baixo; |
claraluques | 5:30f5ffe0ea0b | 331 | printf("baixo high"); |
claraluques | 5:30f5ffe0ea0b | 332 | } |
claraluques | 6:24cbbdf2dac2 | 333 | /*void botbaixo_solto(void) { |
claraluques | 6:24cbbdf2dac2 | 334 | pbaixo = bot_baixo; |
claraluques | 6:24cbbdf2dac2 | 335 | bot_baixo = !bot_baixo; |
claraluques | 5:30f5ffe0ea0b | 336 | printf("baixo low"); |
claraluques | 6:24cbbdf2dac2 | 337 | }*/ |
claraluques | 5:30f5ffe0ea0b | 338 | |
claraluques | 5:30f5ffe0ea0b | 339 |