hi,
I have instalation with which includes:
- Arduino YUN
- Sparkfun CD74HC4067
- FSR sensors
The problem is that reading the first channel affects the values in the others. When I put an object on the first FSR sensor, all channels get values. When I put an object on top of another sensor there is no reaction. What could be the problem? I connected everything according to the instructions
https://learn.sparkfun.com/tutorials/multiplexer-breakout-hookup-guide
It is true that a different multiplexer is used here, does it make any difference?
Thank you for your help!
Hi Tom,
To help we need to see how you connected everything and we need to see your code, otherwise we are relying on telepathy, which in my case doesn't work very well. Please read the forum guidelines at the top of every section then provide more information.
Thanks
@
PerryBebbington sorry, the code is below, this is generic example from sparfun library:
/**
* This example demonstrates how to read analog signals.
*
* It assumes there are potentiometers connected to the 16 channels of the
* 74HC4067 mux.
*
* ------------------------------------------------------------
* Project: arduino-ad-mux-lib
* Source: https://github.com/stechio/arduino-ad-mux-lib.git
*
* Filename: AnalogSignalReadExample.ino
* Version: 1.0
* Author: Nick Lamprianidis (adaptation by Stefano Chizzolini)
*/
#include "Type4067Mux.h"
/*
* Creates a Type4067Mux instance.
*
* 1st-3rd arguments initialize SIG pin (analog input on Arduino PIN A0).
* 4th-7th arguments are the Arduino PINs to which the S0-S3 pins connect.
*/
Type4067Mux mux(A0, INPUT, ANALOG, 8, 9, 10, 11);
void setup() {
// Initializes serial port.
Serial.begin(9600);
// Waits for serial port to connect (needed for Leonardo only).
while (!Serial)
;
}
/*
* Reads the 16 channels and reports on the serial monitor the corresponding
* value read by the A/D converter.
*/
void loop() {
int data;
for (byte i = 0; i < 16; ++i) {
// Reads from channel i (returns a value from 0 to 1023).
data = mux.read(i);
Serial.print("Potentiometer at channel ");
Serial.print(i);
Serial.print(" is at ");
Serial.print((double) (data) * 100 / 1023);
Serial.println("%%");
}
Serial.println();
delay(1500);
}
Ok, I made a mistake using additional connector shield (DF robot IO expansion shield). Everything is fine now 
tomacaster:
Ok, I made a mistake using additional connector shield (DF robot IO expansion shield). Everything is fine now 
GoodI Glad you got it working.
++Karma; // For providing an update and letting us know it's fixed.