chipKIT® Development Platform

Inspired by Arduino™

Majenko SDXL analogRead problem

Created Sat, 27 Jun 2015 07:04:16 +0000 by deladriere


deladriere

Sat, 27 Jun 2015 07:04:16 +0000

I am trying to run this code in UECIDE

/*
void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(A0);
  Serial.println(sensorValue, DEC);
}

but can't read no value. I reads constant value +/- 230 as it was not connected where is the A0 pin ?

228
228
228
229
228
229
228
228
228
228
228
227
228
229
228
228
229
228
229
229
229

majenko

Sat, 27 Jun 2015 10:31:44 +0000

That's the kind of reading I get if I don't have the A0 pin connected to anything and left floating. It works perfectly on my SDXL here, so it could be a hardware issue on your specific board.

A0 is pin RB15, which is pin 30 on the chip (3rd from the right on the same side as the analog pins). Make sure that it's actually soldered properly - I hand build these boards and I did go through a phase where my soldering wasn't what it could have been ... :oops: