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
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)
    {
        
    } 
}