void setup() {
Serial.begin(9600);
pinMode(PA0, INPUT_ANALOG);
}
void loop() {
long ti = micros();
int sensorValue = analogRead(PA0);
long tf = micros() - ti ;
float tensao = (float(sensorValue)/4096) * 3.3;
Serial.print(tf);
Serial.print("us --> ADC =");
Serial.println(tensao);
delay(1000);
}Loading
stm32-bluepill
stm32-bluepill