0.2.5 AnalogKeypad

This commit is contained in:
Rob Tillaart 2024-04-06 10:03:42 +02:00
parent 7c0b2de80f
commit 90b6e550b6
14 changed files with 28 additions and 24 deletions

View File

@ -1,4 +1,5 @@
# These are supported funding model platforms
github: RobTillaart
github: RobTillaart
custom: "https://www.paypal.me/robtillaart"

View File

@ -5,8 +5,9 @@ on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update

View File

@ -1,4 +1,4 @@
---
name: Arduino CI
on: [push, pull_request]
@ -6,12 +6,13 @@ on: [push, pull_request]
jobs:
runTest:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- run: |
gem install arduino_ci
arduino_ci.rb
arduino_ci.rb

View File

@ -9,10 +9,11 @@ on:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"

View File

@ -1,7 +1,7 @@
//
// FILE: AnalogKeypad.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.2.4
// VERSION: 0.2.5
// DATE: 2019-01-31
// PURPOSE: Class for (Robotdyn) 4x4 and 4x3 analog keypad
@ -19,10 +19,10 @@
// Other may have 12 or even 16 bits.
AnalogKeypad::AnalogKeypad(const uint8_t pin, const uint8_t bits)
AnalogKeypad::AnalogKeypad(const uint8_t analogPin, const uint8_t bitsADC)
{
_analogPin = pin;
_analogShift = bits - 8;
_analogPin = analogPin;
_analogShift = bitsADC - 8;
_lastKey = NOKEY;
}

View File

@ -2,7 +2,7 @@
//
// FILE: AnalogKeypad.h
// AUTHOR: Rob Tillaart
// VERSION: 0.2.4
// VERSION: 0.2.5
// DATE: 2019-01-31
// PURPOSE: Class for (Robotdyn) 4x4 and 4x3 analogue keypad
// URL: https://github.com/RobTillaart/AnalogKeypad
@ -11,7 +11,7 @@
#include "Arduino.h"
#define ANALOGKEYPAD_LIB_VERSION (F("0.2.4"))
#define ANALOGKEYPAD_LIB_VERSION (F("0.2.5"))
#define NOKEY 0x00
#define PRESSED 0x80
@ -23,7 +23,8 @@
class AnalogKeypad
{
public:
explicit AnalogKeypad(const uint8_t pin, const uint8_t bits = 10);
// bits is resolution of the internal ADC.
explicit AnalogKeypad(const uint8_t analogPin, const uint8_t bitsADC = 10);
// returns 0 if no key pressed
// otherwise returns key pressed first => ignoring fluctuations

View File

@ -6,10 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.2.5] - 2024-04-06
- update GitHub actions
## [0.2.4] - 2023-10-17
- update readme.md (badges)
## [0.2.3] - 2023-01-21
- update GitHub actions
- update license 2023

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019-2023 Rob Tillaart
Copyright (c) 2019-2024 Rob Tillaart
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -36,9 +36,9 @@ the **MAGIC NUMBERS** in the function **rawRead()**.
#### Constructor
- **AnalogKeypad(const uint8_t pin, const uint8_t bits = 10)** constructor, pin is typical A0 etc.
Bits has a default of 10, but need to be set to match the platform.
If bits < 8 then the internal shift would be large causing all reads to return 0 or so.
- **AnalogKeypad(const uint8_t analogPin, const uint8_t bitsADC = 10)** constructor,
analogPin is typical A0 etc. BitsADC has a default of 10, but need to be set to match the platform.
If bits < 8 then the internal shift would be too large causing all reads to return 0 or so.
#### polling interface

View File

@ -4,7 +4,6 @@
// PURPOSE: demo 4x4 analogue keypad
//
// https://www.tinytronics.nl/shop/nl/arduino/accessoires/robotdyn-keypad-4x4-matrix-analoog?search=matrix
//
#include "AnalogKeypad.h"

View File

@ -4,7 +4,6 @@
// PURPOSE: demo 4x4 analogue keypad
//
// https://www.tinytronics.nl/shop/nl/arduino/accessoires/robotdyn-keypad-4x4-matrix-analoog?search=matrix
//
#include "AnalogKeypad.h"

View File

@ -2,7 +2,6 @@
// FILE: analogKeypad_values.ino
// AUTHOR: Rob Tillaart
// PURPOSE: helper for adjust 4x4 analogue keypad MAGIC numbers
//
#define ANALOGPORT A0

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/AnalogKeypad"
},
"version": "0.2.4",
"version": "0.2.5",
"license": "MIT",
"frameworks": "*",
"platforms": "*",

View File

@ -1,5 +1,5 @@
name=AnalogKeypad
version=0.2.4
version=0.2.5
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino Library for (Robotdyn) 4x4 and 4x3 AnalogKeypad