Funktioniert sowas mit dem CubeMX oder GCC?

Gast #7511106
Lesenswert?

adc_value is real/float

This doesn't work

1
  adc_value :=(ADC1_Get_Sample(1) / 4096)*3.3;

OR this

1
Floattostr(((ADC1_Get_Sample(1) / 4096)*3.3),adc_value_str);

This works

1
 adc_value := ADC1_Get_Sample(1);
2
  adc_value :=(adc_value / 4096)*3.3;

Why, dos the first one always show 0?

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren