Unable to set PB2 as INPUT_PULLUP on a BlackPill STMF411
Posted: Fri Feb 11, 2022 10:03 pm
I'm very new to all of this, so I'm probably missing something obvious.
I'm trying to set PB2 as a pull-up input on a WeAct STM32F411CEU6 BlackPill. The pinMode assignment appears to be ignored and PB2 acts like a pull-down input.
See the below...
Nothing is connected to either PB1 or PB2. PB1 returns 1, and PB2 returns 0.
Does anyone know why? Is there a way to configure PB2 as a pull-up?
Thanks!
I'm trying to set PB2 as a pull-up input on a WeAct STM32F411CEU6 BlackPill. The pinMode assignment appears to be ignored and PB2 acts like a pull-down input.
See the below...
Code: Select all
#include <Arduino.h>
void setup(){
pinMode(PB1, INPUT_PULLUP);
pinMode(PB2, INPUT_PULLUP);
Serial.begin(115200);
}
void loop(){
Serial.println("PB1 = " + (String) digitalRead(PB1));
Serial.println("PB2 = " + (String) digitalRead(PB2));
delay( 1000 );
}
Does anyone know why? Is there a way to configure PB2 as a pull-up?
Thanks!