Majid Pakdel / PXMathLibrary

Dependents:   PXMathLibrary_Example

PXMathLibrary.cpp

Committer:
mpakdel
Date:
2020-06-14
Revision:
0:0a62c0d19710

File content as of revision 0:0a62c0d19710:

#include "mbed.h"
#include "PXMathLibrary.h"

PXMathLibrary::PXMathLibrary(PinName pin1, PinName pin2):_pin1(pin1), _pin2(pin2) {
    
}

void PXMathLibrary::mean() {
    float x = _pin1.read();
    float y = _pin2.read();
    float z = (x+y)/2.0f;
    printf("%10.3f \t %10.3f \t %10.3f \n\r", x, y, z);
}