/* Includes */ #include #include \"stm32f10x.h\" #include \"STM32vldiscovery.h\"
ID: 1812677 • Letter: #
Question
/* Includes */
#include
#include "stm32f10x.h"
#include "STM32vldiscovery.h"
void Delay(__IO uint32_t nCount);
int main(void)
{
STM32vldiscovery_LEDInit(LED3);
STM32vldiscovery_LEDInit(LED4);
STM32vldiscovery_PBInit(BUTTON_USER, BUTTON_MODE_GPIO);
STM32vldiscovery_LEDOff(LED3);
STM32vldiscovery_LEDOff(LED4);
/* Infinite loop */
while (1)
{
/* Toggle LED3 with delay between states */
STM32vldiscovery_LEDOn(LED3);
STM32vldiscovery_LEDOff(LED4);
Delay(658751);
STM32vldiscovery_LEDOff(LED3);
STM32vldiscovery_LEDOn(LED4);
Delay(658751);
}
}
void Delay(__IO uint32_t nCount)
{
for(; nCount != 0; nCount--);
}
Explanation / Answer
Don't forget to enable the external or internal oscillator that you need to use for SYSCLK.
At power-on for default is enabled the internal RC oscillator HSI.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.