grupo 3 - pipfox projeto mecatronico 2021
Dependencies: mbed TouchScreen_kbv_mbed MCUFRIEND_kbv_R299 GLUE_STUFF_kbv ADA_GFX_kbv_R1107
main.cpp@5:fa6ff327713c, 2021-06-01 (annotated)
- Committer:
- stephanie_liu
- Date:
- Tue Jun 01 14:33:34 2021 +0000
- Revision:
- 5:fa6ff327713c
Grupo 3 - PipFox - Codigo desenvolvimento
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
stephanie_liu | 5:fa6ff327713c | 1 | #include "setup.h" |
stephanie_liu | 5:fa6ff327713c | 2 | |
stephanie_liu | 5:fa6ff327713c | 3 | Controlador control{}; |
stephanie_liu | 5:fa6ff327713c | 4 | // control.emerg(); |
stephanie_liu | 5:fa6ff327713c | 5 | |
stephanie_liu | 5:fa6ff327713c | 6 | void emergencia() { control.emerg(); } |
stephanie_liu | 5:fa6ff327713c | 7 | void setup(void) { |
stephanie_liu | 5:fa6ff327713c | 8 | // SETUP - Display |
stephanie_liu | 5:fa6ff327713c | 9 | // tft.reset(); |
stephanie_liu | 5:fa6ff327713c | 10 | // tft.begin(); |
stephanie_liu | 5:fa6ff327713c | 11 | // tft.setRotation(Orientation); |
stephanie_liu | 5:fa6ff327713c | 12 | // tft.fillScreen(BLACK); |
stephanie_liu | 5:fa6ff327713c | 13 | // Motores desligados |
stephanie_liu | 5:fa6ff327713c | 14 | control.variavel_default(); |
stephanie_liu | 5:fa6ff327713c | 15 | desliga_motor(motores[0]); |
stephanie_liu | 5:fa6ff327713c | 16 | desliga_motor(motores[1]); |
stephanie_liu | 5:fa6ff327713c | 17 | desliga_motor(motores[2]); |
stephanie_liu | 5:fa6ff327713c | 18 | // Valores |
stephanie_liu | 5:fa6ff327713c | 19 | vx = 3; |
stephanie_liu | 5:fa6ff327713c | 20 | vy = 3; |
stephanie_liu | 5:fa6ff327713c | 21 | vz = 3; |
stephanie_liu | 5:fa6ff327713c | 22 | // Botão de emergências |
stephanie_liu | 5:fa6ff327713c | 23 | bot_emerg.mode(PullUp); |
stephanie_liu | 5:fa6ff327713c | 24 | bot_emerg.fall(&emergencia); |
stephanie_liu | 5:fa6ff327713c | 25 | // Baud rate - comunicacao serial |
stephanie_liu | 5:fa6ff327713c | 26 | //pc.baud(9600); |
stephanie_liu | 5:fa6ff327713c | 27 | } |
stephanie_liu | 5:fa6ff327713c | 28 | |
stephanie_liu | 5:fa6ff327713c | 29 | void loop(void) { |
stephanie_liu | 5:fa6ff327713c | 30 | x = Ax.read_u16(); // ou Ax.read*1000() |
stephanie_liu | 5:fa6ff327713c | 31 | y = Ay.read_u16(); // ou Ay.read*1000() |
stephanie_liu | 5:fa6ff327713c | 32 | if (control.enable) { |
stephanie_liu | 5:fa6ff327713c | 33 | control.eixo_refere(); |
stephanie_liu | 5:fa6ff327713c | 34 | } |
stephanie_liu | 5:fa6ff327713c | 35 | } |