Projeto_Mecatronico_Team / Mbed 2 deprecated Projeto_Mecatronico

Dependencies:   mbed filesystem TextLCD

Fork of Projeto_Mecatronico by Fernando Sakabe

fim_de_curso.h

Committer:
ricardoparanhos
Date:
2022-05-04
Revision:
12:a50758242f66
Parent:
6:bb07d23b4a84
Child:
16:be88f7617529

File content as of revision 12:a50758242f66:

#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);
            int movimentar_x = 0;
        }
        
        if (FDC_x2 == 0) 
        {
            string estado = "x_mais"; 
            jog_FDC(estado);
        }
        
        if (FDC_y1 == 0) 
        {
            string estado = "y_menos"; 
            jog_FDC(estado);
            int movimentar_y = 0;
        }
        
        if (FDC_y2 == 0) 
        {
            string estado = "y_mais"; 
            jog_FDC(estado);
        }
        
        if (FDC_z1 == 0) 
        {
            string estado = "z_menos"; 
            jog_FDC(estado);
            int movimentar_z = 0;
        }
        
        if (FDC_z2 == 0) 
        {
            string estado = "z_mais" 
            jog_FDC(estado);
        }
    }
}