Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FSR by
Revision 6:71a6328709ea, committed 2017-05-03
- Comitter:
- jd0205
- Date:
- Wed May 03 21:01:09 2017 +0000
- Parent:
- 5:d9520bf7eb9e
- Commit message:
- Just personal changes
Changed in this revision
| FSR.cpp | 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 Wed May 03 21:01:09 2017 +0000
@@ -14,13 +14,13 @@
float FSR::readFSRResistance()
{
float read = _ain;
- return _r * 1 / read - _r;
+ return _r * (1 - read) / read;
}
float FSR::readWeight()
{
float read = _ain;
- float rfsr = _r * 1 / read - _r;
+ float rfsr = _r * (1 - read) / read;
float slope = (4 - 2) / (log10(6.2) - log10(0.25));
float a = log10(rfsr);
if (a < log10(6.2))
