Hi there,
I have a project using a Nano 33 BLE and I need 7 analog inputs. No need for I²C at all.
Chapter 2.2 of the Nano datasheet says:
"As opposed to other Arduino Nano boards, pins A4 and A5 have an internal pull up and default to be used as an I2C Bus so usage as analog inputs is not recommended"
Well, Not recommended is different from prohibited.
So, is there a mean to de-activate these pull ups and taking adantage of these 2 analog inputs ?
Does anybody here have used these two inputs as real analog ?
Thanks
may be try doing the opposite of what they did in the the variant:
// disable I2C pullup and power that were activated @startup
digitalWrite(PIN_ENABLE_SENSORS_3V3, LOW);
digitalWrite(PIN_ENABLE_I2C_PULLUP, LOW);
pinMode(PIN_ENABLE_SENSORS_3V3, INPUT);
pinMode(PIN_ENABLE_I2C_PULLUP, INPUT);
analogRead() does not require the pin to be made as an INPUT upfront (it will use it in the right way), this is just when using the pin in its so called digital capability, but it doesn't hurt to do so
giving it a recognisable name would be good though.
const byte waterSensorPin = A4; // use descriptive variable names
...
pinMode(waterSensorPin, INPUT;) // then use the name in the code