Closed
Description
Describe the bug
analogRead() is returning incorrect / garbage values. A multimeter between PA2 and GND shows the correct value.
To Reproduce
#include <Arduino.h>
void setup() {
Serial.begin(923076);
pinMode(PA2, INPUT_ANALOG);
analogReadResolution(12);
}
void loop() {
Serial.print(analogRead(PA2) / 4096.0 * 3.3);
Serial.println(" V");
delay(200);
}
Steps to reproduce the behavior:
- Run code
- Connect an analog input to PA2
- See incorrect value
Expected behavior
Expected that code reads correct voltage as measured by multimeter.
Desktop:
- OS: Mac
- STM32 core version: 1.6.1
- Upload method: STLink
Board:
- Name: STM32F103C8T6 (Bluepill)