用到的这些东西都是我初学stm32的时候的第一次实验,也是我的入职考核任务,希望可以帮助跟我一样的小白。
led.c
#include "led.h"
void LED_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOF, ENABLE);//ʹÄÜGPIOFʱÖÓ
//GPIOF9,F10³õʼ»¯ÉèÖÃ
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;//ÆÕͨÊä³öģʽ
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//ÍÆÍìÊä³ö
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;//ÉÏÀ
GPIO_Init(GPIOF, &GPIO_InitStructure);//³õʼ»¯
GPIO_SetBits(GPIOF,GPIO_Pin_9 | GPIO_Pin_10);//GPIOF9,F10ÉèÖøߣ¬µÆÃð
}
led.h
pwm.h
pwm.c
adc3.h
adc3.c
第一次发文,不知道有没有人看,有需要后续代码的,评论区评论一下,到时候再分享整份文件吧
需要代码的自己下载哈
链接:https://pan.baidu.com/s/1fl2lW9ewQjfQpj0OqAN_LA
提取码:foil