Coder Social home page Coder Social logo

arduino-analog-multiplexer's People

Contributors

ajfisher avatar rtm516 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  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-analog-multiplexer's Issues

Question - Working with Shift register

Hello,

I'm using your Lib on ESP8266 which is working well. Thanks.
I also use this (http://shiftregister.simsso.de/) library to use a shift register for expanting output pins.

Since I need to free up more pins on the ESP I would like to somehow control the select pins not directly but by the shift register but I got no Idea how since I didn't write code for quite some years.

Therefore could you tell me if/how I could use your code to call the shift register instead setting the pins directly?

Thanks for your help!

Error during compilling

I get an error during compiling event with blank code like:

 #include <analogmuxdemux.h>

void setup() {
}
void loop() {
}


/home/dmtrs/sketchbook/libraries/analogmuxdemux/analogmuxdemux.cpp: In constructor 'AnalogDeMux::AnalogDeMux(uint8_t)':
/home/dmtrs/sketchbook/libraries/analogmuxdemux/analogmuxdemux.cpp:107:68: error: cannot call constructor 'AnalogDeMux::AnalogDeMux' directly [-fpermissive]
     AnalogDeMux::AnalogDeMux(AMDM_MS0, AMDM_MS1, AMDM_MS2, writepin);
                                                                ^
/home/dmtrs/sketchbook/libraries/analogmuxdemux/analogmuxdemux.cpp:107:68: note: for a function-style cast, remove the redundant '::AnalogDeMux'

Switch between mux and demux

Needs to have the ability to switch between mux and demux programmatically using the 4051 chip's ability to use input / output select

Error handle too high pin number

At the moment if you select a pin that is too high for the 4051's 3 bit resolution (>7) then it will just ignore the higher bits and you'll be left what whatever the 3 least significant bits are left over.

The fix will be to somehow fix the number of pins required (probably in the constructor) and from there it would then check for conditions higher than that value.

The question is what should it set it to or should it error and output to debug log or similar?

returning y0 value for all 8 inputs!!

My question is regarding your library/ code for the 4051 IC...I have it all hooked up correctly and it is returning the pin numbers correctly through the serial monitor. But all of the Values are linked to my first readout (y0)...

I did adjust the number of sensors from 3 to 8 to fully use the chip, also changing the could it be something with that change? I have the code example below.

include "analogmuxdemux.h"

define READPIN 0 // What analog input on the arduino do you want?

// how many input pins are you going to use on the Muxer, this example uses three

define NO_PINS 8

// set up the Muxer ready to be used. Watch the order of S0, S1 and S2.
AnalogMux amux(2,3,4, READPIN);

void setup() {
Serial.begin(9600);
Serial.println("Starting 4051 analog reader...");
delay(1000);
}

void loop() {

// go through each pin on the muxer in turn and just print out it's position
// and it's reading then delay a bit and do the next one.
for (int pinno=0; pinno < NO_PINS; pinno++){

    amux.SelectPin(pinno); // choose the pin you want to send signal to off the DeMux
    uint16_t reading = amux.AnalogRead(0);
    Serial.print("Pin: ");
    Serial.print(pinno);
    Serial.print(" Value: ");
    Serial.print(reading);
    Serial.print(" ");
}

Serial.println("-----");
delay(5000);

}

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.