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.
Dependents: POF_force_angle_copy
Revision 2:810db37ddcbc, committed 2019-04-13
- Comitter:
- hi1000
- Date:
- Sat Apr 13 05:55:06 2019 +0000
- Parent:
- 1:a2666eae3d06
- Child:
- 3:99fd973e73c4
- Commit message:
- Pin assignment is confirmed
Changed in this revision
HX711.cpp | Show annotated file Show diff for this revision Revisions of this file |
HX711.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/HX711.cpp Mon Mar 20 13:07:36 2017 +0000 +++ b/HX711.cpp Sat Apr 13 05:55:06 2019 +0000 @@ -108,9 +108,9 @@ _scale = scale; } -float HX711::getGram() +float HX711::getGram(uint8_t times) { - long val = (averageValue() - _offset); + long val = (averageValue(times) - _offset); return (float) val / _scale; }
--- a/HX711.h Mon Mar 20 13:07:36 2017 +0000 +++ b/HX711.h Sat Apr 13 05:55:06 2019 +0000 @@ -39,7 +39,7 @@ int averageValue(uint8_t times = 25 ); void setOffset(int offset); void setScale(float scale = 1990.f); - float getGram(); + float getGram(uint8_t times = 5); void setGain(uint8_t gain); void powerDown(); void powerUp();