Giter Site home page Giter Site logo

stechio / arduino-ad-mux-lib Goto Github PK

View Code? Open in Web Editor NEW
35.0 6.0 16.0 85 KB

Arduino library for controlling analog/digital multiplexers (A/D mux)

License: Other

C++ 100.00%
arduino multiplexer library 74hc4051 74hc4067 cd4051 cd4067 mux cd74hc4067 cd74hc4051

arduino-ad-mux-lib's People

Contributors

stechio avatar thijstriemstra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

arduino-ad-mux-lib's Issues

12-bit ADC

ESP32 has a 12-bit adc (afaik) and returns values between 0 and 4095. Is this supported in e.g. mux.read?

Using boards faster than 30MHz

Hello,
I'm currently working with a Teensy 4.0 and a 4051 to read height pushbuttons, and I came across a bug using this library :

When pressing a button, multiple channels read as pressed, however the bug disappears when the sketch is loaded with the 24MHz clock speed.
It seems like the board is too fast for the Mux, which doesn't have the time to switch between inputs. The bug disappeared when adding a 1 millisecond delay in Mux.cpp, in the setChannel function, which seems to confirm this.

I would like to share my sketch without other people having to modify the library, are there any ways to do that ?
Let me know your thoughts on this !

(I'm French so please excuse me for any weird phrasing or mistakes...)

[ESP32] error: 'analogWrite' was not declared in this scope

When trying to compile this library for ESP32 using PlatformIO the following error occurs:

.pio/libdeps/lolin32/Analog-Digital Multiplexers_ID5363/src/Mux.cpp: In member function 'int8_t Mux::write(uint8_t, int8_t)':
.pio/libdeps/lolin32/Analog-Digital Multiplexers_ID5363/src/Mux.cpp:121:32: error: 'analogWrite' was not declared in this scope
     analogWrite(signalPin, data);
                                ^

platformio config:

[env:lolin32]
platform = espressif32
board = lolin32
framework = arduino

lib_deps =
  Analog-Digital Multiplexers

"Pin" conflicts with FastLED library

If using this library and the FastLED library in a sketch, an error is thrown saying "Pin" is ambiguous in the initialisation declaration ("Pin" is also used by FastLED apparently). I got around it by changing "Pin" to "sigPin" in the library source files, but maybe I'm missing something and it can be done without changing anything in the source files?

mux.read(..) apparently doesn't work in setup()

Hello, in order to simplify my code (to later use the Bounce2 library) I try to create an array of this type before void setup:

int buttonPin [] = {mux.read (0), mux.read (1), mux.read (2), mux.read (3), ... }

However, renaming mux.read (i) only works if it is done inside the void loop.

Am I right or am I doing something wrong?

(I´m not a developer, I´m starting on this. )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.