Skip to content

Commit 685c941

Browse files
committed
0.2.2 X9C10X
1 parent a67908a commit 685c941

File tree

7 files changed

+85
-31
lines changed

7 files changed

+85
-31
lines changed

libraries/X9C10X/.arduino-ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1+
platforms:
2+
rpipico:
3+
board: rp2040:rp2040:rpipico
4+
package: rp2040:rp2040
5+
gcc:
6+
features:
7+
defines:
8+
- ARDUINO_ARCH_RP2040
9+
warnings:
10+
flags:
11+
12+
packages:
13+
rp2040:rp2040:
14+
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
15+
116
compile:
217
# Choosing to run compilation tests on 2 different Arduino platforms
18+
# selected only those that work
319
platforms:
420
- uno
521
# - due
622
# - zero
723
# - leonardo
824
- m4
925
- esp32
10-
# - esp8266
26+
- esp8266
1127
# - mega2560
12-
28+
- rpipico
1329
libraries:
1430
- "printHelpers"

libraries/X9C10X/CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Change Log X9C10X
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
9+
## [0.2.2] - 2022-11-27
10+
- Add RP2040 support to build-CI.
11+
- Add CHANGELOG.md
12+
- update readme.md
13+
- move getPosition() to .cpp
14+
15+
16+
## [0.2.1] - 2022-07-23
17+
- fix #9 add restoreInternalPosition(pos)
18+
- change return type setPosition() to indicate truncation
19+
- update readme.md and comments
20+
- update build-CI tests
21+
22+
## [0.2.0 2022-07-09
23+
- fix #7 incorrect signal during initialize
24+
- remove position parameter from begin() to make setting position more explicit.
25+
- update readme.md
26+
- add uint8_t Ohm2Position()
27+
28+
----
29+
30+
## [0.1.3] - 2022-02-22
31+
- add forced parameter to setPosition()
32+
- update incr() and decr() return bool (made a step)
33+
34+
## [0.1.2] - 2022-02-16
35+
- improve performance
36+
- add sweeper example
37+
- rounding in getOhm(), documentation
38+
39+
## [0.1.1] - 2022-02-15
40+
- improve conditional delay
41+
42+
## [0.1.0] - 2022-01-26
43+
- initial version
44+

libraries/X9C10X/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,23 @@ However that might not always be easy or possible, due to voltage used, etc.
252252

253253
## Future
254254

255+
#### must
255256
- update documentation
256257
- concept of **read()** => put 2 X9C parallel and read one with analogRead().
258+
259+
#### should
257260
- test different platforms
261+
- investigate and test **store()**
262+
263+
#### could
258264
- add error codes ?
259265
- add examples
260-
- investigate and test **store()**
261266
- test multiple devices configuration
262-
267+
- would ohm in float be more precise/accurate?
268+
- especially for the 1K?
269+
- how exact is this device, does it make sense, linear enough?
263270

264271
#### won't
265-
266272
- voltage divider example
267273
- in the constructor rename **Ohm** parameter to value?
268274
- The potentiometer can be used as a voltage divider (see above)

libraries/X9C10X/X9C10X.cpp

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
11
//
22
// FILE: X9C10X.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.2.1
4+
// VERSION: 0.2.2
55
// PURPOSE: Arduino Library for X9C10X series digital potentiometer.
66
// URL: https://github.com/RobTillaart/X9C10X
7-
//
8-
// HISTORY
9-
// 0.1.0 2022-01-26 initial version
10-
// 0.1.1 2022-02-15 improve conditional delay
11-
// 0.1.2 2022-02-16 improve performance, add sweeper example
12-
// rounding in getOhm(), documentation
13-
// 0.1.3 2022-02-22 add forced parameter to setPosition()
14-
// incr() and decr() return bool (made a step)
15-
// 0.2.0 2022-07-09 fix #7 incorrect signal during initialize
16-
// remove position parameter from begin()
17-
// to make setting position more explicit.
18-
// update readme.md
19-
// add uint8_t Ohm2Position()
20-
// 0.2.1 2022-07-23 fix #9 add restoreInternalPosition(pos)
21-
// change return type setPosition() to indicate truncation
22-
// update readme.md and comments
23-
// update build-CI tests
24-
257

268

279
#include "X9C10X.h"
@@ -175,6 +157,12 @@ uint8_t X9C10X::setPosition(uint8_t position, bool forced)
175157
}
176158

177159

160+
uint8_t X9C10X::getPosition()
161+
{
162+
return _position;
163+
}
164+
165+
178166
bool X9C10X::incr()
179167
{
180168
if (_position >= 99) return false;

libraries/X9C10X/X9C10X.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
//
33
// FILE: X9C10X.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.2.1
5+
// VERSION: 0.2.2
66
// PURPOSE: Arduino Library for X9C10X series digital potentiometer.
77
// URL: https://github.com/RobTillaart/X9C10X
88

99

1010
#include "Arduino.h"
1111

12-
#define X9C10X_LIB_VERSION (F("0.2.1"))
12+
#define X9C10X_LIB_VERSION (F("0.2.2"))
1313

1414

1515
/////////////////////////////////////////////////////////
@@ -58,7 +58,7 @@ class X9C10X : public X9C
5858
// forced = default false as that is safer and backwards compatible.
5959
// returns new position 0..99
6060
uint8_t setPosition(uint8_t position, bool forced = false);
61-
uint8_t getPosition() { return _position; };
61+
uint8_t getPosition();
6262

6363
// step size 1.
6464
// return false if end of range reached.
@@ -72,7 +72,7 @@ class X9C10X : public X9C
7272
// position = 0..99
7373
// values > 99 are truncated.
7474
// returns new position 0..99
75-
uint8_t restoreInternalPosition(uint8_t position);
75+
uint8_t restoreInternalPosition(uint8_t position);
7676

7777
// current resistance in ohm.
7878
uint32_t getOhm();
@@ -122,5 +122,5 @@ class X9C503 : public X9C10X
122122
};
123123

124124

125-
// -- END OF FILE --
125+
// -- END OF FILE --
126126

libraries/X9C10X/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/X9C10X.git"
1717
},
18-
"version": "0.2.1",
18+
"version": "0.2.2",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*",

libraries/X9C10X/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=X9C10X
2-
version=0.2.1
2+
version=0.2.2
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino Library for X9C10X series digital potentiometer.

0 commit comments

Comments
 (0)