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.
main.cpp@1:ea27eae94ab2, 2021-04-15 (annotated)
- Committer:
- softris
- Date:
- Thu Apr 15 17:10:47 2021 +0000
- Revision:
- 1:ea27eae94ab2
- Parent:
- 0:6e688c52e0cc
Version de base
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| softris | 0:6e688c52e0cc | 1 | #include "mbed.h" |
| softris | 0:6e688c52e0cc | 2 | #include "Classe_1.h" |
| softris | 0:6e688c52e0cc | 3 | |
| softris | 1:ea27eae94ab2 | 4 | // Objet liaison serie sur USB pour mode debug |
| softris | 1:ea27eae94ab2 | 5 | Serial pc(USBTX, USBRX) ; |
| softris | 0:6e688c52e0cc | 6 | |
| softris | 1:ea27eae94ab2 | 7 | Classe_1 P1 ; |
| softris | 0:6e688c52e0cc | 8 | |
| softris | 1:ea27eae94ab2 | 9 | int main(void) { |
| softris | 1:ea27eae94ab2 | 10 | |
| softris | 1:ea27eae94ab2 | 11 | Point P2 ; |
| softris | 1:ea27eae94ab2 | 12 | |
| softris | 1:ea27eae94ab2 | 13 | P2.x = 3.0f ; |
| softris | 1:ea27eae94ab2 | 14 | P2.y = 4.0f ; |
| softris | 1:ea27eae94ab2 | 15 | |
| softris | 1:ea27eae94ab2 | 16 | P1.fonction_1() ; |
| softris | 0:6e688c52e0cc | 17 | |
| softris | 1:ea27eae94ab2 | 18 | pc.printf( "\n\r sortie 1 : x = %6f \t y = %6f " , P1.point.x , P1.point.y ) ; |
| softris | 1:ea27eae94ab2 | 19 | // sortie 1 : x = y = |
| softris | 1:ea27eae94ab2 | 20 | |
| softris | 1:ea27eae94ab2 | 21 | P1.fonction_3(&P2) ; |
| softris | 0:6e688c52e0cc | 22 | |
| softris | 1:ea27eae94ab2 | 23 | pc.printf( "\n\r sortie 2 : x = %6f \t y = %6f " , P1.point.x , P1.point.y ) ; |
| softris | 1:ea27eae94ab2 | 24 | // sortie 2 : x = y = |
| softris | 1:ea27eae94ab2 | 25 | |
| softris | 1:ea27eae94ab2 | 26 | float ret = P1.fonction_2() ; |
| softris | 0:6e688c52e0cc | 27 | |
| softris | 1:ea27eae94ab2 | 28 | pc.printf( "\n\r sortie 3 : f2 = %6f" , ret ) ; |
| softris | 1:ea27eae94ab2 | 29 | // sortie 3 : f2 = |
| softris | 1:ea27eae94ab2 | 30 | |
| softris | 1:ea27eae94ab2 | 31 | Classe_1 *P3 = new ( Classe_1 ) ; |
| softris | 0:6e688c52e0cc | 32 | |
| softris | 1:ea27eae94ab2 | 33 | P3->fonction_1() ; |
| softris | 1:ea27eae94ab2 | 34 | |
| softris | 1:ea27eae94ab2 | 35 | pc.printf( "\n\r sortie 4 : x = %6f \t y = %6f " , P3->point.x , P3->point.y ) ; |
| softris | 1:ea27eae94ab2 | 36 | // sortie 4 : x = y = |
| softris | 1:ea27eae94ab2 | 37 | |
| softris | 1:ea27eae94ab2 | 38 | P3->fonction_3(&P2) ; |
| softris | 0:6e688c52e0cc | 39 | |
| softris | 1:ea27eae94ab2 | 40 | pc.printf( "\n\r sortie 5 : x = %6f \t y = %6f " , P3->point.x , P3->point.y ) ; |
| softris | 1:ea27eae94ab2 | 41 | // sortie 5 : x = y = |
| softris | 1:ea27eae94ab2 | 42 | |
| softris | 1:ea27eae94ab2 | 43 | ret = P3->fonction_2() ; |
| softris | 1:ea27eae94ab2 | 44 | |
| softris | 1:ea27eae94ab2 | 45 | pc.printf( "\n\r sortie 6 : f2 = %6f" , ret ) ; |
| softris | 1:ea27eae94ab2 | 46 | // sortie 6 : f2 = |
| softris | 1:ea27eae94ab2 | 47 | |
| softris | 1:ea27eae94ab2 | 48 | while(1){} ; |
| softris | 1:ea27eae94ab2 | 49 | |
| softris | 0:6e688c52e0cc | 50 | } |