Joel Pallent
/
Elec241-adc
c
TEST.cpp
- Committer:
- Joelpallent
- Date:
- 2018-05-31
- Revision:
- 0:7088bc4c9949
File content as of revision 0:7088bc4c9949:
#include <stm32f4xx.h> #include <stdio.h> #include "ADC.h" #include "PLL_Config.c" #include "ADC.c" float adc_data_f = 0; unsigned short ADC_DATA = 0; int main(void) { //PLL_Config(); SystemCoreClockUpdate(); init_ADC(); //config ADC while(1) { ADC_DATA=read_adc(); //read value from ADC adc_data_f=(float)ADC_DATA; adc_data_f/=1000.0f; adc_data_f = adc_data_f*0.80513; printf("voltage = %0.2fv\n " , adc_data_f ); } }