mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.2.2 X9C10X
This commit is contained in:
parent
a67908ac20
commit
685c941af1
@ -1,5 +1,21 @@
|
||||
platforms:
|
||||
rpipico:
|
||||
board: rp2040:rp2040:rpipico
|
||||
package: rp2040:rp2040
|
||||
gcc:
|
||||
features:
|
||||
defines:
|
||||
- ARDUINO_ARCH_RP2040
|
||||
warnings:
|
||||
flags:
|
||||
|
||||
packages:
|
||||
rp2040:rp2040:
|
||||
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
|
||||
|
||||
compile:
|
||||
# Choosing to run compilation tests on 2 different Arduino platforms
|
||||
# selected only those that work
|
||||
platforms:
|
||||
- uno
|
||||
# - due
|
||||
@ -7,8 +23,8 @@ compile:
|
||||
# - leonardo
|
||||
- m4
|
||||
- esp32
|
||||
# - esp8266
|
||||
- esp8266
|
||||
# - mega2560
|
||||
|
||||
- rpipico
|
||||
libraries:
|
||||
- "printHelpers"
|
||||
|
44
libraries/X9C10X/CHANGELOG.md
Normal file
44
libraries/X9C10X/CHANGELOG.md
Normal file
@ -0,0 +1,44 @@
|
||||
# Change Log X9C10X
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.2.2] - 2022-11-27
|
||||
- Add RP2040 support to build-CI.
|
||||
- Add CHANGELOG.md
|
||||
- update readme.md
|
||||
- move getPosition() to .cpp
|
||||
|
||||
|
||||
## [0.2.1] - 2022-07-23
|
||||
- fix #9 add restoreInternalPosition(pos)
|
||||
- change return type setPosition() to indicate truncation
|
||||
- update readme.md and comments
|
||||
- update build-CI tests
|
||||
|
||||
## [0.2.0 2022-07-09
|
||||
- fix #7 incorrect signal during initialize
|
||||
- remove position parameter from begin() to make setting position more explicit.
|
||||
- update readme.md
|
||||
- add uint8_t Ohm2Position()
|
||||
|
||||
----
|
||||
|
||||
## [0.1.3] - 2022-02-22
|
||||
- add forced parameter to setPosition()
|
||||
- update incr() and decr() return bool (made a step)
|
||||
|
||||
## [0.1.2] - 2022-02-16
|
||||
- improve performance
|
||||
- add sweeper example
|
||||
- rounding in getOhm(), documentation
|
||||
|
||||
## [0.1.1] - 2022-02-15
|
||||
- improve conditional delay
|
||||
|
||||
## [0.1.0] - 2022-01-26
|
||||
- initial version
|
||||
|
@ -252,17 +252,23 @@ However that might not always be easy or possible, due to voltage used, etc.
|
||||
|
||||
## Future
|
||||
|
||||
#### must
|
||||
- update documentation
|
||||
- concept of **read()** => put 2 X9C parallel and read one with analogRead().
|
||||
|
||||
#### should
|
||||
- test different platforms
|
||||
- investigate and test **store()**
|
||||
|
||||
#### could
|
||||
- add error codes ?
|
||||
- add examples
|
||||
- investigate and test **store()**
|
||||
- test multiple devices configuration
|
||||
|
||||
- would ohm in float be more precise/accurate?
|
||||
- especially for the 1K?
|
||||
- how exact is this device, does it make sense, linear enough?
|
||||
|
||||
#### won't
|
||||
|
||||
- voltage divider example
|
||||
- in the constructor rename **Ohm** parameter to value?
|
||||
- The potentiometer can be used as a voltage divider (see above)
|
||||
|
@ -1,27 +1,9 @@
|
||||
//
|
||||
// FILE: X9C10X.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.1
|
||||
// VERSION: 0.2.2
|
||||
// PURPOSE: Arduino Library for X9C10X series digital potentiometer.
|
||||
// URL: https://github.com/RobTillaart/X9C10X
|
||||
//
|
||||
// HISTORY
|
||||
// 0.1.0 2022-01-26 initial version
|
||||
// 0.1.1 2022-02-15 improve conditional delay
|
||||
// 0.1.2 2022-02-16 improve performance, add sweeper example
|
||||
// rounding in getOhm(), documentation
|
||||
// 0.1.3 2022-02-22 add forced parameter to setPosition()
|
||||
// incr() and decr() return bool (made a step)
|
||||
// 0.2.0 2022-07-09 fix #7 incorrect signal during initialize
|
||||
// remove position parameter from begin()
|
||||
// to make setting position more explicit.
|
||||
// update readme.md
|
||||
// add uint8_t Ohm2Position()
|
||||
// 0.2.1 2022-07-23 fix #9 add restoreInternalPosition(pos)
|
||||
// change return type setPosition() to indicate truncation
|
||||
// update readme.md and comments
|
||||
// update build-CI tests
|
||||
|
||||
|
||||
|
||||
#include "X9C10X.h"
|
||||
@ -175,6 +157,12 @@ uint8_t X9C10X::setPosition(uint8_t position, bool forced)
|
||||
}
|
||||
|
||||
|
||||
uint8_t X9C10X::getPosition()
|
||||
{
|
||||
return _position;
|
||||
}
|
||||
|
||||
|
||||
bool X9C10X::incr()
|
||||
{
|
||||
if (_position >= 99) return false;
|
||||
|
@ -2,14 +2,14 @@
|
||||
//
|
||||
// FILE: X9C10X.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.1
|
||||
// VERSION: 0.2.2
|
||||
// PURPOSE: Arduino Library for X9C10X series digital potentiometer.
|
||||
// URL: https://github.com/RobTillaart/X9C10X
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#define X9C10X_LIB_VERSION (F("0.2.1"))
|
||||
#define X9C10X_LIB_VERSION (F("0.2.2"))
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
@ -58,7 +58,7 @@ public:
|
||||
// forced = default false as that is safer and backwards compatible.
|
||||
// returns new position 0..99
|
||||
uint8_t setPosition(uint8_t position, bool forced = false);
|
||||
uint8_t getPosition() { return _position; };
|
||||
uint8_t getPosition();
|
||||
|
||||
// step size 1.
|
||||
// return false if end of range reached.
|
||||
@ -72,7 +72,7 @@ public:
|
||||
// position = 0..99
|
||||
// values > 99 are truncated.
|
||||
// returns new position 0..99
|
||||
uint8_t restoreInternalPosition(uint8_t position);
|
||||
uint8_t restoreInternalPosition(uint8_t position);
|
||||
|
||||
// current resistance in ohm.
|
||||
uint32_t getOhm();
|
||||
@ -122,5 +122,5 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/X9C10X.git"
|
||||
},
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=X9C10X
|
||||
version=0.2.1
|
||||
version=0.2.2
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino Library for X9C10X series digital potentiometer.
|
||||
|
Loading…
Reference in New Issue
Block a user