-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
145 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
/* | ||
HX711_ADC configuration | ||
Allowed values for "SAMPLES" is 4, 8, 16, 32 or 64. | ||
Allowed values for "SAMPLES" is 1, 2, 4, 8, 16, 32, 64 or 128. | ||
Higher value = improved filtering/smoothing of returned value, but longer setteling time and increased memory usage | ||
Lower value = visa versa | ||
The settling time can be calculated as follows: | ||
Settling time = SAMPLES + IGN_HIGH_SAMPLE + IGN_LOW_SAMPLE / SPS | ||
Example on calculating settling time using the values SAMPLES = 16, IGN_HIGH_SAMPLE = 1, IGN_LOW_SAMPLE = 1, and HX711 sample rate set to 10SPS: | ||
(16+1+1)/10 = 1.8 seconds settling time | ||
(16+1+1)/10 = 1.8 seconds settling time. | ||
Note that you can also overide (reducing) the number of samples in use at any time with the function: setSamplesInUse(samples). | ||
*/ | ||
|
||
#define SAMPLES 16 // no of samples in moving average data set, value must be 4, 8, 16, 32 or 64 | ||
#define IGN_HIGH_SAMPLE 1 // adds one sample to the set and ignore peak high sample, value must be 0 or 1 | ||
#define IGN_LOW_SAMPLE 1 // adds one sample to the set and ignore peak low sample, value must be 0 or 1 | ||
//number of samples in moving average data set, value must be 1, 2, 4, 8, 16, 32, 64 or 128. | ||
#define SAMPLES 16 //default value: 16 | ||
|
||
//adds extra sample(s) to the data set and ignore peak high/low sample, value must be 0 or 1. | ||
#define IGN_HIGH_SAMPLE 1 //default value: 1 | ||
#define IGN_LOW_SAMPLE 1 //default value: 1 | ||
|
||
//1 microsecond delay after writing sck pin high or low. Could be required for faster mcu's (but both the Arduino Due and ESP8266 seems to run fine without this delay) | ||
//Change the value to '1' if delay is required. | ||
#define SCK_DELAY 0 //default value: 0 | ||
|
||
//Note: If you for some reason want to read out single conversions only, SAMPLES can be set to 1 provided that both IGN_HIGH_SAMPLE and IGN_LOW_SAMPLE is set to 0 | ||
//if you have some other time consuming (>60μs) interrupt routines that trigger while the sck pin is high, this could unintentionally set the HX711 into "power down" mode | ||
//if required you can change the value to '1' to disable interrupts when writing to the sck pin. | ||
#define SCK_DISABLE_INTERRUPTS 0 //default value: 0 |