Getting real values into my mbed

How do I get in real time values from my voltage square waveform and my current square waveform into my mbed compiler to be able to calculate the angle between the waveforms