Go Down

Topic: Arduino Due Multiple AI Problem (Read 1 time) previous topic - next topic

Steinhoff

Hi guys I'm trying to read analog values from several of the analog inputs, but they only work ok if used induvidually. When I put several analogRead in the loop and return the values through serial, they seem to correspond to only one channel.
Does anybody here tried this with an ArduinoDue?, could it be broken? I dont want to buy another one just to see if its a bug or not, and need to solve this in order to choose Arduino Due for future projects.

Thought the multiplexer needed more time to change channel, but even with big delays it still happens.
Maybe it was applied voltage, but I connected ai2 and ai3 to GND and 3.3v and the same happens...

Any help would be much appreciated

Code: [Select]

void setup()
  {
    analogReadResolution(12);
    Serial.begin(9600);     
  }
void loop()
  {
    Serial.println(analogRead(2));
    delay(50);
    Serial.println(analogRead(3));
    delay(50);
    Serial.println(" ");
    delay(50);
  }

Steinhoff

Ok no replies... it is a bug in Arduino IDE 1.5.5, fixed in version 1.5.6 beta r2 or 1.5.4

JWScotSat

#2
Jun 02, 2014, 08:54 am Last Edit: Jun 02, 2014, 08:56 am by JWScotSat Reason: 1
A very quick search would have brought you here: http://forum.arduino.cc/index.php?topic=242867

Edit:

Infact that is your first post. Your original question is answered by Grumpy Mike, read the pin twice and scrap the first reading when changing pins.

Go Up