#include "stm32f10x.h" #include "../../Drivers/gpiodriver.h" #include "../../Drivers/adcdriver.h" #define ADCPRE 14 #define SQ1 0 #define ADON 0 void LEDClignotte(void) { if(ADC1->DR >= 3102) { MyGPIO_Set(GPIOA,5); } else{ MyGPIO_Reset(GPIOA,5); } } int main (void) { MyGPIO_Struct_TypeDef led = {GPIOA,5,Out_PullUp}; //led MyADC_Struct_TypeDef adcStruct = {ADC1,10,cycles41d5}; MyGPIO_Struct_TypeDef adc = {GPIOC,0,In_Analog}; MyGPIO_Init(&led); MyADC_Init(&adcStruct); MyADC_Init_Periph(LEDClignotte); MyGPIO_Init(&adc); while(1){ //MyADC_Start(ADC1); /* if(ADC1->DR >= 3102) { MyGPIO_Set(GPIOA,5); } else{ MyGPIO_Reset(GPIOA,5); } */ }; }