Comments (6)
I made a fix and submitted pull request #27.
#27
from bounce2.
Where is the _BV macro defined? Is this only with the Due? Are you using Arduino.cc or Arduino.org?
from bounce2.
_BV() has been so widely used in Arduino code for so long, I had always assumed it was part of the Arduino code library. But looking into this, it turns out to be part of avr-libc.
http://www.nongnu.org/avr-libc/user-manual/group__avr__sfr.html
Perhaps a simpler patch might look like:
#ifndef _BV
#define _BV(n) (1<<(n))
#endif
from bounce2.
It builds on the Arduino Mega 2560. I'm guessing a problem with non AVR cores, based on Paul's comment.
I'm running Arduino 1.6.6. The "About Arduino" references Arduino.cc .
I chose to replace every "_BV" with "bit" because "bit" is actually in Arduino.h, so presumably that is the party approved solution for Arduino.
Personally, I think typing out the bit shift code explicitly (1<<bits) is preferable, because nobody has to guess what it does, and it's about the same number of characters. I can't see any advantage to making a macro of this. But since it was done, I'm trying to stick with the system.
from bounce2.
I will add Paul's patch as it is the minimum of modification required to fix this.
from bounce2.
FYI this was also a problem with Cortex M0 SAMD21 (used by Arduino Zero and others like the Adafruit Feather M0 boards). With the patch it builds fine.
regards,
Hamish
from bounce2.
Related Issues (20)
- Add separate up/down timeouts HOT 1
- Request: Allow multiple physical pins or software-only "pin" for each Bounce2 object HOT 1
- Nit: int type used in examples instead of bool or boolean
- Request: add Button class state output method isPressed() HOT 2
- Hardware abstraction should be by composition rather than inheritance HOT 6
- error: 'class Bounce' has no member named 'setPressedState' HOT 1
- Can't compile for Arduino Zero HOT 5
- Publish version 2.55 as a GitHub release HOT 1
- Library works on arduino Due but not on Zero (same sketch). HOT 3
- Debouncer::getStateFlag() and Debouncer::read() should be const HOT 6
- Problems with currentDuration () HOT 4
- Doesn't work with framework-arduinoespressif32-release_IDF4.4? HOT 2
- New release and deprecate duration() HOT 7
- Functions do work with the array type of setup HOT 3
- Does #define BOUNCE_LOCK_OUT work? HOT 4
- Todo : Allow the selection of debounce algorithm from the sketch instead of adding a define to the source HOT 1
- Teensy 4.1 Problems
- Pressing buttons simultaneously
- define bounce in two ways? HOT 5
- Bounce reports incorrect state if button is held down when attach() is called HOT 5
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 bounce2.