File tree Expand file tree Collapse file tree 6 files changed +30
-15
lines changed Expand file tree Collapse file tree 6 files changed +30
-15
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
6
6
7
7
8
+ ## [ 0.5.0] - 2024-06-17
9
+ - fix #50 , bug in constructor (thanks Mathieu!)
10
+ - refactor constructor
11
+
12
+ ----
13
+
8
14
## [ 0.4.0] - 2024-03-02
9
15
- add fastProcessor option in ** begin()** (Thanks to palmerr23)
10
16
- updated license
Original file line number Diff line number Diff line change 1
1
//
2
2
// FILE: HX711.cpp
3
3
// AUTHOR: Rob Tillaart
4
- // VERSION: 0.4 .0
4
+ // VERSION: 0.5 .0
5
5
// PURPOSE: Library for load cells for UNO
6
6
// URL: https://github.com/RobTillaart/HX711_MP
7
7
// URL: https://github.com/RobTillaart/HX711
12
12
13
13
HX711::HX711 ()
14
14
{
15
+ _gain = HX711_CHANNEL_A_GAIN_128;
16
+ _offset = 0 ;
17
+ _scale = 1 ;
18
+ _lastRead = 0 ;
19
+ _price = 0 ;
20
+ _mode = HX711_AVERAGE_MODE;
21
+ _fastProcessor = false ;
15
22
}
16
23
17
24
@@ -38,10 +45,11 @@ void HX711::reset()
38
45
{
39
46
power_down ();
40
47
power_up ();
48
+ _gain = HX711_CHANNEL_A_GAIN_128;
41
49
_offset = 0 ;
42
50
_scale = 1 ;
43
- _gain = HX711_CHANNEL_A_GAIN_128;
44
51
_lastRead = 0 ;
52
+ _price = 0 ;
45
53
_mode = HX711_AVERAGE_MODE;
46
54
}
47
55
Original file line number Diff line number Diff line change 2
2
//
3
3
// FILE: HX711.h
4
4
// AUTHOR: Rob Tillaart
5
- // VERSION: 0.4 .0
5
+ // VERSION: 0.5 .0
6
6
// PURPOSE: Library for load cells for Arduino
7
7
// URL: https://github.com/RobTillaart/HX711_MP
8
8
// URL: https://github.com/RobTillaart/HX711
9
9
//
10
10
// NOTES
11
11
// Superset of interface of HX711 class of Bogde
12
- // float instead of long as float has 23 bits mantissa.
12
+ // uses float instead of long as float has 23 bits mantissa
13
+ // which almost perfectly matches the 24 bit ADC.
13
14
14
15
15
16
#include " Arduino.h"
16
17
17
- #define HX711_LIB_VERSION (F(" 0.4 .0" ))
18
+ #define HX711_LIB_VERSION (F(" 0.5 .0" ))
18
19
19
20
20
21
const uint8_t HX711_AVERAGE_MODE = 0x00 ;
@@ -175,16 +176,16 @@ class HX711
175
176
uint8_t _dataPin;
176
177
uint8_t _clockPin;
177
178
178
- uint8_t _gain = 128 ; // default channel A
179
- long _offset = 0 ;
180
- float _scale = 1 ;
181
- uint32_t _lastRead = 0 ;
182
- float _price = 0 ;
183
- uint8_t _mode = HX711_AVERAGE_MODE;
179
+ uint8_t _gain;
180
+ long _offset;
181
+ float _scale;
182
+ uint32_t _lastRead;
183
+ float _price;
184
+ uint8_t _mode;
185
+ bool _fastProcessor;
184
186
185
187
void _insertSort (float * array, uint8_t size);
186
188
uint8_t _shiftIn ();
187
- bool _fastProcessor = false ;
188
189
};
189
190
190
191
Original file line number Diff line number Diff line change @@ -386,7 +386,7 @@ See https://github.com/RobTillaart/HX711/issues/40
386
386
- example the adding scale
387
387
- void weight_clr(), void weight_add(), float weight_get() - adding scale
388
388
- decide pricing keep/not => move to .cpp
389
- - add ** setRate()** and ** getRate()**
389
+ - add ** setRate()** and ** getRate()** - sample rate 10/80 SPS
390
390
- optional?
391
391
392
392
Original file line number Diff line number Diff line change 15
15
"type" : " git" ,
16
16
"url" : " https://github.com/RobTillaart/HX711"
17
17
},
18
- "version" : " 0.4 .0" ,
18
+ "version" : " 0.5 .0" ,
19
19
"license" : " MIT" ,
20
20
"frameworks" : " *" ,
21
21
"platforms" : " *" ,
Original file line number Diff line number Diff line change 1
1
name =HX711
2
- version =0.4 .0
2
+ version =0.5 .0
3
3
author =Rob Tillaart <rob.tillaart@gmail.com>
4
4
maintainer =Rob Tillaart <rob.tillaart@gmail.com>
5
5
sentence =Arduino library for HX711 load cell amplifier
You can’t perform that action at this time.
0 commit comments