mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-09-19 16:46:11 -04:00
0.1.3 rotaryDecoderSwitch
This commit is contained in:
parent
f2bf989d84
commit
b25fa79612
@ -1,11 +1,29 @@
|
||||
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
|
||||
- zero
|
||||
- leonardo
|
||||
# - due
|
||||
# - zero
|
||||
# - leonardo
|
||||
- m4
|
||||
- esp32
|
||||
- esp8266
|
||||
- mega2560
|
||||
# - mega2560
|
||||
- rpipico
|
||||
|
||||
|
27
libraries/rotaryDecoderSwitch/CHANGELOG.md
Normal file
27
libraries/rotaryDecoderSwitch/CHANGELOG.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Change Log rotaryDecoderSwitch
|
||||
|
||||
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.1.3] - 2022-11-23
|
||||
- add changelog.md
|
||||
- add RP2040 to build-CI
|
||||
- fix version number .cpp
|
||||
- minor edits
|
||||
|
||||
|
||||
## [0.1.2] - 2021-12-27
|
||||
- update library.json
|
||||
- update readme.md
|
||||
- update license
|
||||
- minor edits
|
||||
|
||||
## [0.1.1] - 2021-11-16
|
||||
- update build-CI, readme.md, badges
|
||||
- improve readability of code
|
||||
|
||||
## [0.1.0] - 2021-05-17
|
||||
- initial version
|
@ -78,7 +78,8 @@ assumes that the rotary encoder only goes into a single direction.
|
||||
|
||||
- **uint32_t getValue(uint8_r re)** returns the RE counter. (re = 0 or 1).
|
||||
- **void setValue(uint8_r re, uint32_t val = 0)** (re)set the internal counter to val, default 0
|
||||
- **bool isKeyPressed(uint8_t re)** returns true is the switch is pressed of the RE selected (re = 0 or 1). Note one needs to call **update()** first!
|
||||
- **bool isKeyPressed(uint8_t re)** returns true is the switch is pressed of the RE selected (re = 0 or 1).
|
||||
Note one needs to call **update()** first!
|
||||
|
||||
|
||||
## Debugging
|
||||
@ -126,6 +127,14 @@ See examples..
|
||||
|
||||
## Future
|
||||
|
||||
- think of what to do with the two "idle lines"
|
||||
#### must
|
||||
- update documentation
|
||||
- add schematic.
|
||||
- add schema
|
||||
- keep in sync with rotaryDecoder library
|
||||
|
||||
#### should
|
||||
- think of what to do with the two "idle lines"
|
||||
|
||||
#### could
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Syntax Colouring Map For rotaryDecoder
|
||||
# Syntax Colouring Map For rotaryDecoderSwitch
|
||||
|
||||
|
||||
# Data types (KEYWORD1)
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "rotaryDecoderSwitch",
|
||||
"keywords": "rotary,encoder,PCF8574",
|
||||
"description": "Arduino library to rotary decoder with a PCF8574\nSupports up to 2 RE's with switch",
|
||||
"description": "Arduino library for rotary decoder+switch with a PCF8574\nSupports up to 2 RE's with switch",
|
||||
"authors":
|
||||
[
|
||||
{
|
||||
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/rotaryDecoderSwitch.git"
|
||||
},
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*",
|
||||
|
@ -1,8 +1,8 @@
|
||||
name=rotaryDecoderSwitch
|
||||
version=0.1.2
|
||||
version=0.1.3
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library to rotary decoder with a PCF8574
|
||||
sentence=Arduino library for rotary decoder+switch with a PCF8574
|
||||
paragraph=Supports up to 2 RE's with a switch
|
||||
category=Data Processing
|
||||
url=https://github.com/RobTillaart/rotaryDecoderSwitch
|
||||
|
@ -1,16 +1,10 @@
|
||||
//
|
||||
// FILE: rotaryDecoderSwitch.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.1
|
||||
// VERSION: 0.1.3
|
||||
// DATE: 2021-05-17
|
||||
// PURPOSE: rotary decoder library for Arduino
|
||||
// PURPOSE: Arduino library for rotary decoder (with switch)
|
||||
// URL: https://github.com/RobTillaart/rotaryDecoderSwitch
|
||||
//
|
||||
// HISTORY:
|
||||
// 0.1.0 2021-05-17 initial version
|
||||
// 0.1.1 2021-11-16 update build-CI, readnme.md, badges
|
||||
// improve readability of code
|
||||
// 0.1.2 2021-12-27 update library.json, readme, license, minor edits
|
||||
|
||||
|
||||
#include "rotaryDecoderSwitch.h"
|
||||
@ -150,13 +144,6 @@ bool rotaryDecoderSwitch::updateSingle()
|
||||
}
|
||||
|
||||
|
||||
uint8_t rotaryDecoderSwitch::_read8()
|
||||
{
|
||||
_wire->requestFrom(_address, (uint8_t)1);
|
||||
return _wire->read();
|
||||
}
|
||||
|
||||
|
||||
bool rotaryDecoderSwitch::isKeyPressed(uint8_t re)
|
||||
{
|
||||
uint8_t mask = 0x04;
|
||||
@ -165,5 +152,16 @@ bool rotaryDecoderSwitch::isKeyPressed(uint8_t re)
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
//
|
||||
// PRIVATE
|
||||
//
|
||||
uint8_t rotaryDecoderSwitch::_read8()
|
||||
{
|
||||
_wire->requestFrom(_address, (uint8_t)1);
|
||||
return _wire->read();
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -2,16 +2,16 @@
|
||||
//
|
||||
// FILE: rotaryDecoderSwitch.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.2
|
||||
// VERSION: 0.1.3
|
||||
// DATE: 2021-05-17
|
||||
// PURPOSE: rotary decoder library for Arduino
|
||||
// PURPOSE: Arduino library for rotary decoder (with switch)
|
||||
// URL: https://github.com/RobTillaart/rotaryDecoderSwitch
|
||||
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Wire.h"
|
||||
|
||||
#define ROTARY_DECODER_SWITCH_LIB_VERSION (F("0.1.2"))
|
||||
#define ROTARY_DECODER_SWITCH_LIB_VERSION (F("0.1.3"))
|
||||
|
||||
|
||||
class rotaryDecoderSwitch
|
||||
@ -45,6 +45,7 @@ public:
|
||||
uint8_t getLastPosition(uint8_t re) { return _lastPos[re]; };
|
||||
uint8_t getRaw() { return _read8(); };
|
||||
|
||||
|
||||
private:
|
||||
uint8_t _count = 0;
|
||||
uint8_t _lastValue = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user