Seek&Destroyers / Mbed 2 deprecated test_avance

Dependencies:   mbed

main.cpp

Committer:
GJ23
Date:
2015-03-31
Revision:
3:013492d1db6d
Parent:
2:e443871f42f2
Child:
4:a61068858bcf

File content as of revision 3:013492d1db6d:

#include "mbed.h"

Serial pc(USBTX, USBRX);
InterruptIn entree1(D9);
DigitalOut sortie1(A0);
DigitalOut sortie2(A1);

int cran=0;

void frontMontant1()
{
    cran=cran+1;
    pc.printf("cran: %f \n\r",cran);
}

void avancer(int distance_mm)
{
    int nb_cran_max=(distance_mm/195)*16;
    cran=0;
        
    while(cran<=nb_cran_max)
    {
     sortie1 = 1;  
     sortie2 = 0; 
    }
    
    sortie1 = 0;  
    sortie2 = 0;   
}

void main()
{
    entree1.rise(&frontMontant1);
    pc.printf("Start \n\r");
    sortie1 = 0;  
    sortie2 = 0;  
    avancer(350);
    while(1)
    {
        
    } 
}