Unable to use digital read

Hi folks,

I'm experiencing a very weird behaviour on the nano 33 BLE SENSE.

I'm trying to read a simple button press, connected to pin D3 using a pulldown resistor. The value read, however, is always HIGH.

I tried swapping the nano BLE with other nano BLE and get the same result.

To check if the problem was in my wiring I also tried to upload the same sketch on a nano 33IOT and indeed the button works as expected

Setting the pin as INPUT_PULLUP and changing the wiring on the breadboard also produce the expected result.

If I measure the voltage on the pin when the button is open, instead of 0V I read 1.3 which really I don't understand.

Here is a picture of my wiring https://photos.app.goo.gl/a8qW3v6FSykh3L6R8

Could you please post your sketch? This might sound silly but could be important.

Please use code tags. Click Preview in the Quick Reply and use the </> button.

Hi Klaus_k.

I'm actually just using the simple digitalReadSerial example.

/*
  DigitalReadSerial

  Reads a digital input on pin 2, prints the result to the Serial Monitor

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/DigitalReadSerial
*/

// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 3;

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // make the pushbutton's pin an input:
  pinMode(pushButton, INPUT);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input pin:
  int buttonState = digitalRead(pushButton);
  // print out the state of the button:
  Serial.println(buttonState);
  delay(1);        // delay in between reads for stability
}

The sketch you posted and your exact circuit works as expected on my Nano 33 BLE Sense. I also get a ~1.3 V voltage reading across the pull-down resistor.

Does the problem occur on any pin, or only pin 3?

Thank you for reporting this. There is a PR to fix it. You can find it here

Indeed the PR solves the issue.
Thanks Arturo!