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@1:7f8b8f2bc12f, 2015-03-31 (annotated)
- 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?
| User | Revision | Line number | New 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 |