I'm new to the forum, transitioning a project from Arduino to the L432KC. I'm running out of ADC pins and need 1 additional. I can't use A7 (PA2) because that pin is reserved for USB VCP TX, which I need for debugging.
The mbed pinout at the link below shows that D3 (PB0) is ADC1/15. However, it is not listed as ADC in the datasheet. I have tried setting it up as an analog input in a simple sketch and it doesn't work. Behaves just like any other digital pin when you try analog read.
Can PB_0 be used as an ADC input pin as the pinout indicates? If so, how do I set it for that? Alternatively, is there another way to free up A7 without losing my USB serial comms?
https://os.mbed.com/platforms/ST-Nucleo-L432KC/
Code: Select all
void setup() {
Serial.begin(9600);
pinMode(3, INPUT_ANALOG);
}
void loop() {
int val = analogRead(3);
Serial.println(val);
delay(250);
}