Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Revision 18:1374daf4e6a3, committed 2021-05-19
- Comitter:
- diogonac
- Date:
- Wed May 19 17:03:46 2021 +0000
- Parent:
- 17:f3a45eeb1a7e
- Commit message:
- Deteccao de fonte externa
Changed in this revision
JOG_EIXO_Z.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/JOG_EIXO_Z.cpp Wed May 19 17:00:31 2021 +0000 +++ b/JOG_EIXO_Z.cpp Wed May 19 17:03:46 2021 +0000 @@ -6,6 +6,7 @@ AnalogIn eixo_Z(PC_2); InterruptIn posicao_salva(PA_15); InterruptIn botao_emergencia(PC_4); +DigitalIn botao_indicador_fonte_externa(PC_10); BusOut motor_z(PB_1, PB_15, PB_14, PB_13); @@ -19,6 +20,7 @@ int passo_fuso = 5; int pegaZ; int posicao_salva_estado, botao_emergencia_estado; +int fonte_externa; void rotina_posicao_salva(void); void rotina_emergencia(void); @@ -41,11 +43,13 @@ J_Z = eixo_Z.read_u16(); posicao_salva_estado = posicao_salva.read(); botao_emergencia_estado = botao_emergencia.read(); + fonte_externa = botao_indicador_fonte_externa.read(); pc.printf("Z=%4d, PegaZ=%4d, Posicao_salva_estado=%d, Botao_emergencia_estado=%d, Tempo1=%4f, Tempo2=%4f, Pulsos=%d, Deslocamento_Z=%f, Velocidade_Z=%f\r\n", J_Z, pegaZ, posicao_salva_estado, botao_emergencia_estado, tempo_horario, tempo_anti_horario, pulsos_anti_horario, deslocamento_total_Z, velocidade_Z); - rotida_aciona_motor(); - + if(fonte_externa == 1) { + rotida_aciona_motor(); + } } }