Library to read rawdata from an FSR
Dependents: K64F-RTOS-MQTT-Example
Fork of FSR by
Revision 6:bf85a85d7808, committed 2017-05-02
- Comitter:
- ram54288
- Date:
- Tue May 02 16:48:41 2017 +0000
- Parent:
- 5:d9520bf7eb9e
- Commit message:
- Changed the return types to *ptr
Changed in this revision
| FSR.cpp | Show annotated file Show diff for this revision Revisions of this file |
| FSR.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/FSR.cpp Thu Oct 22 17:06:17 2015 +0000
+++ b/FSR.cpp Tue May 02 16:48:41 2017 +0000
@@ -11,10 +11,14 @@
return read;
}
-float FSR::readFSRResistance()
+float* FSR::readFSRResistance()
{
float read = _ain;
- return _r * 1 / read - _r;
+ //float* obj=new float;
+ //obj=(_r * 1 / read - _r);
+ //return obj;
+ float t=(_r * 1 / read - _r);
+ return &t;
}
float FSR::readWeight()
--- a/FSR.h Thu Oct 22 17:06:17 2015 +0000
+++ b/FSR.h Tue May 02 16:48:41 2017 +0000
@@ -42,7 +42,7 @@
*
* @return the resistance of the FSR
*/
- float readFSRResistance();
+ float* readFSRResistance();
/** Read the weight in N. 0 anyway if the weight is less than 100g
*
