I'm using a RFduino to do analogRead at pin 2, and pin 0.

Pin 2 works correctly. Pin 0 returns zero all the time. I measured the voltage at pin 0, and it's 3.3V (Vcc).

I turned off the circuit, and double checked that there's no connection between pin 0 and Vcc (used the multimeter, at the sound mode). As soon as I plug into power, V at pin0 is Vcc.

How do I fix this problem?

#include <RFduinoBLE.h>

static const int topPin = 2;
static const int bottomPin = 0;

int top;
int bottom;

void setup() {
  // put your setup code here, to run once:
  pinMode(topPin, INPUT);
  pinMode(bottomPin, INPUT);

void loop() {
  // put your main code here, to run repeatedly:
    RFduino_ULPDelay( SECONDS(0.01) );

    bottom = analogRead(bottomPin);
    top = analogRead(topPin);

    Serial.print(" ");

Browse other questions tagged or ask your own question.