Softris BE_3R / Mbed 2 deprecated Test_classes

Dependencies:   mbed

main.cpp

Committer:
softris
Date:
2021-04-15
Revision:
1:ea27eae94ab2
Parent:
0:6e688c52e0cc

File content as of revision 1:ea27eae94ab2:

#include "mbed.h"
#include "Classe_1.h"

// Objet liaison serie sur USB pour mode debug
Serial pc(USBTX, USBRX) ;

Classe_1 P1 ;

int main(void) {
      
    Point   P2 ;
    
    P2.x = 3.0f ;
    P2.y = 4.0f ;
    
    P1.fonction_1() ;
    
    pc.printf( "\n\r sortie 1 : x = %6f \t y = %6f " , P1.point.x , P1.point.y ) ;
    // sortie 1 : x =       y = 
    
    P1.fonction_3(&P2) ;
    
    pc.printf( "\n\r sortie 2 : x = %6f \t y = %6f " , P1.point.x , P1.point.y ) ;
    // sortie 2 : x =       y = 
    
    float ret = P1.fonction_2() ;
    
    pc.printf( "\n\r sortie 3 : f2 = %6f" , ret ) ;
    // sortie 3 : f2 =       
    
    Classe_1 *P3 = new ( Classe_1  ) ;
    
    P3->fonction_1() ;
    
    pc.printf( "\n\r sortie 4 :  x = %6f \t y = %6f " , P3->point.x , P3->point.y ) ;
    // sortie 4 : x =       y = 
    
    P3->fonction_3(&P2) ;
    
    pc.printf( "\n\r sortie 5 : x = %6f \t y = %6f " , P3->point.x , P3->point.y ) ;
    // sortie 5 : x =       y = 
    
    ret = P3->fonction_2() ;
    
    pc.printf( "\n\r sortie 6 : f2 = %6f" , ret ) ;
    // sortie 6 : f2 =   
    
    while(1){} ;
    
}