MPC23017 analogRead???

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
gearjunkie88
 
Posts: 12
Joined: Thu Feb 13, 2014 9:11 pm

MPC23017 analogRead???

Post by gearjunkie88 »

Hello

I am working on a project where I will have 12 force sensitive resistors (like these: http://www.adafruit.com/products/166). I am using a MPC23017 "port expander" to connect all these to my Uno. I am using the Adafruit MPC23017 library to communicate with the sensors -- via digitalRead. This returns a 0 or 1 (of course). There is no analogRead in the Adafruit library. Is there a way to get an analog value from the sensor? And... at what point does "no pressure" (i.e., a reading of 0) turn into "yes pressure" (i.e., a reading of 1)? Is there a way to fine-tune that if I must use the digitalRead function in absence of an analogRead function?

Thanks!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: MPC23017 analogRead???

Post by adafruit_support_rick »

There is no defined point at which a 0 becomes a 1. It will vary across individual parts.
You should be using an ADC instead of an MCP23017. The MCP23017 is strictly a digital part - it has no analog input capability.

ADCs:
8-channel SPI: http://www.adafruit.com/products/856
4-channel I2C: http://www.adafruit.com/products/1083

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”