How to get Analog input from arduino shield pins?

21 May 2016

Hello I connected humidity sensor to A1 on the Arduino shield pins. When I read it from mbed in the following way:

AnalogIn ain(PB_0); ain.read();

I get digital ( 0 or 1). What am I doing wrong?

Also worth mentioning - using A1 (instead of PB_0) doesn't work in the mbed compiler for me.

Thank you,

10 May 2016

I managed to solve the 0/1 problem - turns out I was reading it into an int so it was just rounding it. Now that I read it into a float, or use read_u16 it's fine.

However, the A1 thing is still not working.