Skip to content

Commit cde49e7

Browse files
committed
0.2.1 HX710AB
1 parent 6ecbf48 commit cde49e7

File tree

6 files changed

+30
-26
lines changed

6 files changed

+30
-26
lines changed

libraries/HX710AB/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88

9+
## [0.2.1] - 2025-06-19
10+
- fix **is_ready()** (see HX711 #65)
11+
912
## [0.2.0] - 2024-11-17
10-
- breaking change, aligned function names with HX711 where possible
13+
- breaking change, aligned function names with HX711 where possible
1114
- implement base class HX710AB (reduce source duplication)
1215
- implement async interface, three functions
1316
- **void request()**, **bool is_ready()**, **fetch()**

libraries/HX710AB/HX710AB.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: HX710AB.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.2.0
5+
// VERSION: 0.2.1
66
// PURPOSE: Arduino library for the HX710A and HX710B 24-Bit ADC.
77
// DATE: 2024-11-08
88
// URL: https://github.com/RobTillaart/HX710AB
@@ -12,7 +12,7 @@
1212

1313
#include "Arduino.h"
1414

15-
#define HX710AB_LIB_VERSION (F("0.2.0"))
15+
#define HX710AB_LIB_VERSION (F("0.2.1"))
1616

1717

1818
//////////////////////////////////////////////////////////////////////////////
@@ -35,7 +35,7 @@ class HX710AB
3535

3636
void begin(bool fastProcessor = false)
3737
{
38-
pinMode(_dataPin, INPUT);
38+
pinMode(_dataPin, INPUT_PULLUP);
3939
pinMode(_clockPin, OUTPUT);
4040
digitalWrite(_clockPin, LOW);
4141
_fastProcessor = fastProcessor;
@@ -70,17 +70,17 @@ class HX710AB
7070
request();
7171
while (! is_ready()) yield();
7272
return fetch(differential);
73-
};
73+
}
7474

7575
uint32_t last_time_read()
7676
{
7777
return _lastTimeRead;
78-
};
78+
}
7979

8080
uint32_t last_value_read()
8181
{
8282
return _value;
83-
};
83+
}
8484

8585
////////////////////////////////////////////////////
8686
//
@@ -95,15 +95,15 @@ class HX710AB
9595
}
9696
x /= n;
9797
return (x - _offset) * _scale;
98-
};
98+
}
9999

100100

101101
////////////////////////////////////////////////////
102102
//
103103
// TWO POINT CALIBRATION
104104
//
105105
// keep offset scale "compatible" with HX711 library.
106-
//
106+
//
107107
bool calibrate(int32_t x1, float y1, int32_t x2, float y2)
108108
{
109109
if ((x1 == x2) || (y2 == y1)) return false;
@@ -115,24 +115,24 @@ class HX710AB
115115
void set_offset(float offset)
116116
{
117117
_offset = offset;
118-
};
118+
}
119119

120120
float get_offset()
121121
{
122122
return _offset;
123-
};
123+
}
124124

125125
bool set_scale(float scale)
126126
{
127127
if (scale == 0) return false;
128128
_scale = 1.0 / scale;
129129
return true;
130-
};
130+
}
131131

132132
float get_scale()
133133
{
134134
return 1.0 / _scale;
135-
};
135+
}
136136

137137

138138
///////////////////////////////////////////////
@@ -142,12 +142,12 @@ class HX710AB
142142
void power_down()
143143
{
144144
digitalWrite(_clockPin, HIGH);
145-
};
145+
}
146146

147147
void power_up()
148148
{
149149
digitalWrite(_clockPin, LOW);
150-
};
150+
}
151151

152152

153153
protected:
@@ -157,7 +157,7 @@ class HX710AB
157157
if (_fastProcessor) delayMicroseconds(1);
158158
digitalWrite(_clockPin, LOW);
159159
if (_fastProcessor) delayMicroseconds(1);
160-
};
160+
}
161161

162162
uint8_t _dataPin;
163163
uint8_t _clockPin;
@@ -178,7 +178,7 @@ class HX710A : public HX710AB
178178
public:
179179
HX710A(uint8_t dataPin, uint8_t clockPin) : HX710AB(dataPin, clockPin)
180180
{
181-
};
181+
}
182182

183183

184184
int32_t fetch(bool differential = true)
@@ -221,7 +221,7 @@ class HX710B : public HX710AB
221221
public:
222222
HX710B(uint8_t dataPin, uint8_t clockPin) : HX710AB(dataPin, clockPin)
223223
{
224-
};
224+
}
225225

226226

227227
int32_t fetch(bool differential = true)
@@ -249,9 +249,9 @@ class HX710B : public HX710AB
249249
// extend sign if needed
250250
if (_value & 0x800000) _value |= 0xFF000000;
251251
return _value;
252-
};
252+
}
253253

254-
// TODO getVOltage()
254+
// TODO getVoltage()
255255
};
256256

257257

libraries/HX710AB/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024-2024 Rob Tillaart
3+
Copyright (c) 2024-2025 Rob Tillaart
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

libraries/HX710AB/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,19 @@ So powerUp() is seldom needed.
194194
#### Should
195195

196196
- test extensively
197+
- fix TODO's in code
197198

198199
#### Could
199200

200201
- extend unit tests(?)
201-
- more examples.
202+
- add more examples.
202203
- extend performance test sketch
203-
- AVR optimized code - see FastShiftIn.
204-
(low gain as sensor blocks at 10/40 Hz)
205204

206205
#### Wont
207206

208207
- bool isPowerUp();
208+
- AVR optimized code - see FastShiftIn.
209+
(low gain as sensor blocks at 10/40 Hz)
209210

210211
## Support
211212

libraries/HX710AB/library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/HX710AB.git"
1717
},
18-
"version": "0.2.0",
18+
"version": "0.2.1",
1919
"license": "MIT",
2020
"frameworks": "*",
2121
"platforms": "*",

libraries/HX710AB/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=HX710AB
2-
version=0.2.0
2+
version=0.2.1
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino library for the HX710A and HX710B 24-Bit ADC.

0 commit comments

Comments
 (0)