You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/X9C10X/README.md
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,10 +68,13 @@ Note: **begin()** has a hard coded 500uS delay so the device can wake up.
68
68
Note: multiple devices can be controlled, just by giving them an unique selectPin.
69
69
This behaviour is similar to the SPI select pin.
70
70
71
-
-**void setPosition(uint8_t position)** sets the wiper to a position between 0 and 99.
71
+
-**void setPosition(uint8_t position, bool forced = false)** sets the wiper to a position between 0 and 99. The movement is relative to the current (cached) position.
72
+
If forced is set to true, the cached position is ignored and the new position will be cached.
72
73
-**uint8_t getPosition()** returns the current position.
73
-
-**void incr()** moves one position up (if possible).
74
-
-**void decr()** moves one position down (if possible).
74
+
-**bool incr()** moves one position up (if possible).
75
+
Returns true if moved and false if already at end position.
76
+
-**bool decr()** moves one position down (if possible).
77
+
Returns true if moved and false if already at end position.
75
78
-**uint32_t getOhm()** returns the position expressed in Ohm.
76
79
The returned value does depend on the value passed in the constructor.
77
80
-**uint32_t getMaxOhm()** returns the maximum value ( = parameter from constructor).
@@ -155,6 +158,14 @@ Note: check datasheet for the range of the max voltage allowed.
155
158
156
159
- test different platforms
157
160
- improve the hardcoded 500us delay in **begin()**
158
-
- add return code to **setPosition() incr() decr()** ?
159
161
- add error codes ?
160
162
- test **store()**
163
+
- in the constructor rename **Ohm** parameter to value?
164
+
- The potentiometer can be used as a voltage divider (see above)
165
+
so a better parameter name could be the anonymous **value**.
0 commit comments