Seek&Destroyers / Mbed 2 deprecated test_avance

Dependencies:   mbed

Committer:
GJ23
Date:
Tue Mar 31 12:51:04 2015 +0000
Revision:
1:7f8b8f2bc12f
Parent:
0:d42483d446b2
Child:
2:e443871f42f2
SD

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GJ23 0:d42483d446b2 1 #include "mbed.h"
GJ23 0:d42483d446b2 2
GJ23 1:7f8b8f2bc12f 3 InterruptIn entree1(D9);
GJ23 1:7f8b8f2bc12f 4 DigitalOut sortie1(A0);
GJ23 1:7f8b8f2bc12f 5 DigitalOut sortie2(A1);
GJ23 0:d42483d446b2 6
GJ23 0:d42483d446b2 7 int cran=0;
GJ23 0:d42483d446b2 8
GJ23 0:d42483d446b2 9 void frontMontant1()
GJ23 0:d42483d446b2 10 {
GJ23 0:d42483d446b2 11 cran++;
GJ23 0:d42483d446b2 12 }
GJ23 0:d42483d446b2 13
GJ23 1:7f8b8f2bc12f 14 void avancer(int distance_mm)
GJ23 1:7f8b8f2bc12f 15 {
GJ23 1:7f8b8f2bc12f 16 int nb_cran_max=(distance_mm/195)*16;
GJ23 1:7f8b8f2bc12f 17 cran=0;
GJ23 1:7f8b8f2bc12f 18
GJ23 1:7f8b8f2bc12f 19 while(cran<=nb_cran_max)
GJ23 1:7f8b8f2bc12f 20 {
GJ23 1:7f8b8f2bc12f 21 sortie1 = 1;
GJ23 1:7f8b8f2bc12f 22 sortie2 = 0;
GJ23 1:7f8b8f2bc12f 23 }
GJ23 1:7f8b8f2bc12f 24
GJ23 1:7f8b8f2bc12f 25 }
GJ23 1:7f8b8f2bc12f 26
GJ23 1:7f8b8f2bc12f 27 void main()
GJ23 1:7f8b8f2bc12f 28 {
GJ23 1:7f8b8f2bc12f 29 entree1.rise(&frontMontant1);
GJ23 1:7f8b8f2bc12f 30 avancer(350);
GJ23 1:7f8b8f2bc12f 31 while(1)
GJ23 1:7f8b8f2bc12f 32 {
GJ23 1:7f8b8f2bc12f 33
GJ23 1:7f8b8f2bc12f 34 }
GJ23 1:7f8b8f2bc12f 35 }
GJ23 0:d42483d446b2 36