This is the development sandbox for the DRV425EVM and its magnetic sensing.
Dependencies: mbed
Repository for the 2015 OhmBoyZ Capstone group.
Diff: main.cpp
- Revision:
- 14:9748a17f6bce
- Parent:
- 13:51e3bfd1f6c0
- Child:
- 15:478a1f3ad7c2
--- a/main.cpp Tue Dec 08 02:28:57 2015 +0000 +++ b/main.cpp Tue Dec 08 02:32:02 2015 +0000 @@ -11,7 +11,7 @@ printf("\n\rAnalogIn example\n\r"); while(1) { meas = analog_value.read(); // Converts and read the analog input value (value from 0.0 to 1.0) - meas = meas * 3.3; // Change the value to be in the 0 to 3.3 range (currently to mV) + meas *= 3.3; // Change the value to be in the 0 to 3.3 range (currently to mV) printf("meas = %fmV\n\r",meas*1000); // Print out raw measurement in terms of mV b=(meas-(3.3/2.0))/(4.0*12.2*100.0); // Based on equation 1 from DRV425EVM pdf //VVOUT [V] = B × G × RSHUNT × GAMP = B [uT] × 12.2 mA/mT × RSHUNT [Ω] × 4 [V/V]