Comments (5)
Of course, holding()
is a status, not an event. tick will return true on hold
event, once
from encbutton.
Do you have only one tick
function in loop?
from encbutton.
yes, I do: just one tick()
is in the loop() for encoder with button. I also have a separate button with a dedicated button.tick()
in the loop()...
should mention, V2 works like a charm :-)
from encbutton.
no, v3 is more stable than v2, I'm sure that you do something wrong. Try examples from library. And give me a minimal example with this bug. Because tick always returns true
on events, there can't be event without true result
from encbutton.
ok, please, test two options:
void loop() {
static uint32_t cycleCounter = 0;
static uint32_t holdingBthCycleCounter = 0;
bool buttonHolding = false;
cycleCounter++;
if( button.tick() ) buttonHolding = button.holding();
if( buttonHolding ) {
holdingBthCycleCounter++;
Serial.print( "cycle# " ); Serial.println( cycleCounter );
Serial.print( "holding button cycle# "); Serial.println( holdingBthCycleCounter );
Serial.flush();
}
}
and:
void loop() {
static uint32_t cycleCounter = 0;
static uint32_t holdingBthCycleCounter = 0;
bool buttonHolding = false;
cycleCounter++;
button.tick();
buttonHolding = button.holding();
if( buttonHolding ) {
holdingBthCycleCounter++;
Serial.print( "cycle# " ); Serial.println( cycleCounter );
Serial.print( "holding button cycle# "); Serial.println( holdingBthCycleCounter );
Serial.flush();
}
}
the difference is only in handling holding()
event... and when the button is pressed & held, there should be a print out for holding counter for each loop() cycle… which is not happening for the 1st option…
from encbutton.
Related Issues (20)
- Проблема с энкодерами HOT 2
- Не работают прерывания, как следует на stm32 HOT 1
- Добавить поддержку энкодера HOT 18
- Не работает на Arduino Nano 33 BLE HOT 36
- Опрос кнопок в момент перезагрузки устройства HOT 5
- Проект на wokwi с кнопками EncButton HOT 61
- Todo? HOT 8
- the 'eb.clear()' does not really set the encoder counter to 0 HOT 1
- Unusual step counting by rotary encoder HOT 5
- Многократное срабатывание виртуальной кнопки при однократном нажатии кнопки HOT 3
- fast() всегда false
- Ke-040 и 74hc165 HOT 9
- Совместимость с ESP8266 (Wemos D1 Mini) HOT 4
- Передать аргументы в событие. HOT 9
- 3.5.1 Won't compile HOT 1
- Описка в README HOT 1
- Внутрення подтяжка пинов INPUT_PULLUP HOT 13
- Невозможно использовать библиотеку после обновления до 3.5.9 HOT 2
- Иногда нет обработки вращения энкодера HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from encbutton.