jlxaiyjx

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

stm32点亮灯(2023/7/18)

#include "stm32f10x.h" // Device header
int main(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);//设置时钟
GPIO_InitTypeDef GPIO_InitStructure;//初始化的宏定义
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;//设置推挽模式
GPIO_InitStructure.GPIO_Pin=GPIO_Pin_13;//打开13脚,自带的led灯
GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;//一般情况下都是50HZ
GPIO_Init(GPIOC,&GPIO_InitStructure);//初始化函数调用
//GPIO_SetBits(GPIOC,GPIO_Pin_13);//引脚高电平设置

//GPIO_WriteBit(GPIOC,GPIO_Pin_13,Bit_SET);赋值引脚高电平,和GPIO_SetBits(GPIO,GPIO_Pin_13)具有相同的使用效果
GPIO_ResetBits(GPIOC,GPIO_Pin_13);//引脚低电平设置

//GPIO_WriteBit(GPIOC,GPIO_Pin_13,Bit_RESET);引脚赋值低电平
while(1)
{
}

}

 

 

 输出结果显示

 

posted on   蒋果是果  阅读(39)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
点击右上角即可分享
微信分享提示