Does anyone know why on Due analog input pull-up not working.
According to datasheet there is pull-up on analog input also.
I tried to put it on but there is nothing happens.
I tried pinMode(A0, INPUT_PULLUP);
then digitalWrite(A0, HIGH);
then REG_PIOA_SODR = 0x0000000F this is register for pull UP on A0 input.
Yes i make analogread(A0)
I didn't know that it tern pull-up off.
I tried Example sketch
int sensorValue = 0; // value read from the pot
void setup() {
// initialize serial communications at 9600 bps:
Serial.begin(9600);
pinMode(A0, INPUT_PULLUP);
//digitalWrite(A0, HIGH);
//REG_PIOA_SODR = 0x0000000F;
}
void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);
// map it to the range of the analog out:
// change the analog out value:
// print the results to the serial monitor:
Serial.print("sensor = " );
Serial.print(sensorValue);
// wait 2 milliseconds before the next loop
// for the analog-to-digital converter to settle
// after the last reading:
delay(2000);
}
and analogread show floating reads 200-700 with no input