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 filesystem TextLCD
Fork of Projeto_Mecatronico by
fim_de_curso.h
- Committer:
- ricardoparanhos
- Date:
- 2022-05-03
- Revision:
- 6:bb07d23b4a84
- Parent:
- fim_de_curso.cpp@ 4:c849dfdaab59
- Child:
- 12:a50758242f66
File content as of revision 6:bb07d23b4a84:
#include "mbed.h"
#include "JOG.h"
//Fim de cursos eixo x
DigitalIn FDC_x1(PA_2);
DigitalIn FDC_x2(PA_10);
//Fim de cursos eixo y
DigitalIn FDC_y1(PA_8);
DigitalIn FDC_y2(PA_9);
//Fim de cursos eixo z
DigitalIn FDC_z1(PC_7);
DigitalIn FDC_z2(PB_6);
void fim_de_curso()
{
FDC_x1.mode(PullUp);
FDC_x2.mode(PullUp);
FDC_y1.mode(PullUp);
FDC_y2.mode(PullUp);
FDC_z1.mode(PullUp);
FDC_z2.mode(PullUp);
float tempo = 0.5; // "tempo"
while (1)
{
if (FDC_x1 == 0)
{
string estado = "x_menos"
jog_FDC(estado);
}
if (FDC_x2 == 0)
{
string estado = "x_mais"
jog_FDC(estado);
}
if (FDC_y1 == 0)
{
string estado = "y_menos"
jog_FDC(estado);
}
if (FDC_y2 == 0)
{
string estado = "y_mais"
jog_FDC(estado);
}
if (FDC_z1 == 0)
{
string estado = "z_menos"
jog_FDC(estado);
}
if (FDC_z2 == 0)
{
string estado = "z_mais"
jog_FDC(estado);
}
}
}
