My project design requires me to switch back and forth between muxShield.setMode(1,DIGITAL_OUT) and muxShield.setMode(1,ANALOG_IN). I discovered that the arduino analog input measurement is accurate if the measurement is made first thing from reset/bootup. Once I switch to DIGITAL_OUT and back to ANALOG_IN then the analog measurements are dramatically off of ‘expected’. Resetting the Arduino is the only fix I have figured out.
To verify that is was not my code, I modified your “MuxShieldAnalogin” example so that the sketch would switch back and forth between ANALOG_IN and DIGITAL_OUT.
Do you have a solution to this issue I have encountered?