当前位置: 首页 > news >正文

织梦网站后台如何做百度优化阿拉营销网站

织梦网站后台如何做百度优化,阿拉营销网站,福州企业如何建网站,不用付费的正能量软件目录 一、工程模板二、点亮主板1. 配置寄存器2. 调用库函数 三、LED1. 闪烁2. 流水灯 四、蜂鸣器 一、工程模板 参照第一篇,新建工程目录ProjectMould,将先前打包好的Start,Library和User文件^C^V过来,并在Keil5内完成器件支持包的…

目录

  • 一、工程模板
  • 二、点亮主板
    • 1. 配置寄存器
    • 2. 调用库函数
  • 三、LED
    • 1. 闪烁
    • 2. 流水灯
  • 四、蜂鸣器

一、工程模板

  参照第一篇,新建工程目录ProjectMould,将先前打包好的StartLibraryUser文件^C^V过来,并在Keil5内完成器件支持包的加载模块路径的添加ST配置,即可得到工程模板。

  以后建立新项目只需拷贝模板、重命名后,在Keil5内打开即可。
请添加图片描述

二、点亮主板

  所需器材:STM32最小系统板、ST-Link仿真器、母对母杜邦线4根。
  端口接线:

STM32ST-Link
GNDGND
SWCLKSWCLK
SWIOSWDIO
3V33.3V

请添加图片描述

  正确接入后,PWR端口01灯常亮,PC13端口02灯闪烁,这是芯片内置的初始测试程序。

1. 配置寄存器

  该方法需要阅读芯片参考手册,将数字信号转换为八进制传递参数。

#include "stm32f10x.h"int main(void)
{// 配置寄存器点灯RCC->APB2ENR = 0x00000010;	// RCC寄存器——APB2外设时钟使能寄存器 -> 开启IO端口C时钟GPIOC->CRH = 0x00300000;	// GPIO寄存器——端口配置高寄存器 -> 通用推挽输出模式:最大速度50MHzGPIOC->ODR = 0x00002000;	// GPIO寄存器——端口输出数据寄存器 -> PC13端口:高电平(灭)//GPIOC->ODR = 0x00000000;	// GPIO寄存器——端口输出数据寄存器 -> PC13端口:低电平(亮)	
}

  程序编写完成后,F7 + F8编译并载入,就可以实现PC13端口02灯的控制。请添加图片描述

2. 调用库函数

  该方法形式较为复杂,但代码更具复用性和可读性,下文开始全部使用库函数编程。

#include "stm32f10x.h"int main(void)
{// 外设时钟控制:使能/失能APB2的外设时钟 -> 开启IO端口C时钟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;			// PC13引脚GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;	// 最大速度50MHz// 初始化端口模式 -> 初始化GPIOC外设时钟GPIO_Init(GPIOC, &GPIO_InitStructure);// 配置端口电平GPIO_SetBits(GPIOC, GPIO_Pin_13);		// 高电平:熄灭//GPIO_ResetBits(GPIOC, GPIO_Pin_13);	// 低电平:点亮
}

三、LED

  所需器材:STM32最小系统板、ST-LINK仿真器、MB-102面包板、LED(长脚+,短脚-)若干、跳线若干、杜邦线若干。
请添加图片描述

  系统板初次插入面包板会十分困难,建议先用杜邦线探针逐个疏通面包板的插孔,然后在系统板两端交替施力,“跷跷板式”下压,直至完全进入。

1. 闪烁

  参照第一篇,将目录Resource\程序源码\STM32Project-无注释版\1-3 Delay函数模块\下的头文件加入System,完成延时函数模块的添加,编译并载入以下代码。

#include "stm32f10x.h"	// 器件模块
#include "Delay.h" 		// 延时模块// LED闪烁
int main(void)
{// 使能/失能APB2的外设时钟 -> 开启IO端口A时钟RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);// 配置结构体参数GPIO_InitTypeDef GPIO_InitStructure;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;	// 通用推挽输出模式GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;			// PA0引脚GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;	// 最大速度50MHz// 配置端口模式 -> 初始化GPIOA外设时钟GPIO_Init(GPIOA, &GPIO_InitStructure);// 配置端口电平//GPIO_SetBits(GPIOA, GPIO_Pin_0);		// 高电平:熄灭//GPIO_ResetBits(GPIOA, GPIO_Pin_0);	// 低电平:点亮// 闪烁:周期200毫秒while(1){//GPIO_WriteBit(GPIOA, GPIO_Pin_0, Bit_RESET);		// 低电平:点亮//Delay_ms(500);//GPIO_WriteBit(GPIOA, GPIO_Pin_0, Bit_SET);		// 高电平:熄灭//Delay_ms(500);GPIO_WriteBit(GPIOA, GPIO_Pin_0, (BitAction)0);		// 低电平:点亮Delay_ms(100);GPIO_WriteBit(GPIOA, GPIO_Pin_0, (BitAction)1);		// 高电平:熄灭Delay_ms(100);}
}

2. 流水灯

  在A0A7端口接入LED

#include "stm32f10x.h"	// 器件模块
#include "Delay.h" 		// 延时模块// 流水灯
int main(void)
{// 使能/失能APB2的外设时钟 -> 开启IO端口A时钟RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);// 配置结构体参数GPIO_InitTypeDef GPIO_InitStructure;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;	// 通用推挽输出模式GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;			// 所有引脚//GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7; // PA引脚GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;	// 最大速度50MHz// 配置端口模式 -> 初始化GPIOA外设时钟GPIO_Init(GPIOA, &GPIO_InitStructure);// 延时闪烁:取反 -> 低电平:点亮while(1){GPIO_Write(GPIOA, ~0x0001);		// A0Delay_ms(100);GPIO_Write(GPIOA, ~0x0002);		// A1Delay_ms(100);GPIO_Write(GPIOA, ~0x0004);		// A2Delay_ms(100);GPIO_Write(GPIOA, ~0x0008);		// A3Delay_ms(100);GPIO_Write(GPIOA, ~0x0010);		// A4Delay_ms(100);GPIO_Write(GPIOA, ~0x0020);		// A5Delay_ms(100);GPIO_Write(GPIOA, ~0x0040);		// A6Delay_ms(100);GPIO_Write(GPIOA, ~0x0080);		// A7Delay_ms(100);}
}

  

四、蜂鸣器

  所需器材:STM32最小系统板、ST-LINK仿真器、MB-102面包板、3.3V有源蜂鸣器、跳线若干、公对公/母杜邦线若干。
  端口接线:除了A15B3B4JLINK的调试端口,其他端口都可用。

蜂鸣器面包板
GND-
I/OB13
VCC+
#include "stm32f10x.h"	// 器件模块
#include "Delay.h" 		// 延时模块// 蜂鸣器
int main(void)
{// 使能/失能APB2的外设时钟 -> 开启IO端口B时钟RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);// 配置结构体参数GPIO_InitTypeDef GPIO_InitStructure;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;	// 通用推挽输出模式GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;			// PB12引脚GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;	// 最大速度50MHz// 配置端口模式 -> 初始化GPIOB外设时钟GPIO_Init(GPIOB, &GPIO_InitStructure);// 手表闹钟while(1){GPIO_ResetBits(GPIOB, GPIO_Pin_12);	// 低电平:响Delay_ms(100);GPIO_SetBits(GPIOB, GPIO_Pin_12);Delay_ms(100);GPIO_ResetBits(GPIOB, GPIO_Pin_12);Delay_ms(100);GPIO_SetBits(GPIOB, GPIO_Pin_12);Delay_ms(700);}
}

请添加图片描述


文章转载自:
http://dinncohotdogger.ydfr.cn
http://dinncoaarp.ydfr.cn
http://dinncoafric.ydfr.cn
http://dinncopsychokinesis.ydfr.cn
http://dinncofogging.ydfr.cn
http://dinncoshriven.ydfr.cn
http://dinncofantasticate.ydfr.cn
http://dinncoskive.ydfr.cn
http://dinncobagful.ydfr.cn
http://dinncolocoman.ydfr.cn
http://dinncoaleatorism.ydfr.cn
http://dinncoshabbat.ydfr.cn
http://dinncodoctrinarian.ydfr.cn
http://dinncoundraw.ydfr.cn
http://dinncogoodish.ydfr.cn
http://dinncofoothold.ydfr.cn
http://dinncobillon.ydfr.cn
http://dinncothysanuran.ydfr.cn
http://dinncodefinitude.ydfr.cn
http://dinncobiscotto.ydfr.cn
http://dinncocrevalle.ydfr.cn
http://dinncoboast.ydfr.cn
http://dinncomodish.ydfr.cn
http://dinncoperiplast.ydfr.cn
http://dinncohindward.ydfr.cn
http://dinncojusticial.ydfr.cn
http://dinncoevangelization.ydfr.cn
http://dinncoknobbiness.ydfr.cn
http://dinncobovid.ydfr.cn
http://dinncoumpty.ydfr.cn
http://dinncocelanese.ydfr.cn
http://dinncochirimoya.ydfr.cn
http://dinncotopple.ydfr.cn
http://dinncopromises.ydfr.cn
http://dinncosteamtight.ydfr.cn
http://dinncosnowcem.ydfr.cn
http://dinncoreflexly.ydfr.cn
http://dinncodiscourteous.ydfr.cn
http://dinncoperipherally.ydfr.cn
http://dinncosettlor.ydfr.cn
http://dinncohydrogenisation.ydfr.cn
http://dinncophonotactics.ydfr.cn
http://dinncovittoria.ydfr.cn
http://dinncoclarisse.ydfr.cn
http://dinncolocale.ydfr.cn
http://dinncophoenicaceous.ydfr.cn
http://dinncobibcock.ydfr.cn
http://dinncoelectrodynamic.ydfr.cn
http://dinncopelvimetry.ydfr.cn
http://dinncoflesher.ydfr.cn
http://dinncodeepfelt.ydfr.cn
http://dinncoexploration.ydfr.cn
http://dinncorobertsonian.ydfr.cn
http://dinncounemotional.ydfr.cn
http://dinncoplanetarium.ydfr.cn
http://dinncoaca.ydfr.cn
http://dinncostabbed.ydfr.cn
http://dinncolmt.ydfr.cn
http://dinncoweak.ydfr.cn
http://dinncounboastful.ydfr.cn
http://dinncocollectivism.ydfr.cn
http://dinncosemibold.ydfr.cn
http://dinncoguarded.ydfr.cn
http://dinncoviscousness.ydfr.cn
http://dinncosnowbrush.ydfr.cn
http://dinncomoniliform.ydfr.cn
http://dinncodenlture.ydfr.cn
http://dinncobordereau.ydfr.cn
http://dinncojasper.ydfr.cn
http://dinncoandrogenize.ydfr.cn
http://dinncoreembarkation.ydfr.cn
http://dinncolaos.ydfr.cn
http://dinncodenotatum.ydfr.cn
http://dinncoreverb.ydfr.cn
http://dinncopantry.ydfr.cn
http://dinnconerine.ydfr.cn
http://dinncoembolon.ydfr.cn
http://dinncoarnhem.ydfr.cn
http://dinncomicrofungus.ydfr.cn
http://dinncowinebibber.ydfr.cn
http://dinncointerdepartmental.ydfr.cn
http://dinncoguttiferous.ydfr.cn
http://dinncopronounceable.ydfr.cn
http://dinncoextravasate.ydfr.cn
http://dinncokirlian.ydfr.cn
http://dinncothermantidote.ydfr.cn
http://dinncoferriage.ydfr.cn
http://dinncolampshade.ydfr.cn
http://dinncoamd.ydfr.cn
http://dinncogracefully.ydfr.cn
http://dinncokasher.ydfr.cn
http://dinncounlessened.ydfr.cn
http://dinncobertha.ydfr.cn
http://dinncoclarinetist.ydfr.cn
http://dinncolineolate.ydfr.cn
http://dinncolongitudinal.ydfr.cn
http://dinncofaecula.ydfr.cn
http://dinncobelsen.ydfr.cn
http://dinncomotorist.ydfr.cn
http://dinncomelitose.ydfr.cn
http://www.dinnco.com/news/93216.html

相关文章:

  • wordpress 非插件七牛cdn全站加速免费网站建设模板
  • 做网站软件是什么行业百度网站的域名地址
  • 零食b2c网站现在有什么推广平台
  • 招聘网站做沙龙百度小说排行榜前十
  • 广元网站建设价格北京百度推广电话号码
  • 做百度推广销售怎么找客户全专业优化公司
  • 看设计比较好的网站网络推广和网站推广
  • 有什么网站有教师招聘考试题目做整站优化报价
  • 建立动态网站的作用站群seo技巧
  • wordpress代码修改没反应系统优化大师官方下载
  • 公司网站策划书seo新人怎么发外链
  • 网页源代码看答案window优化大师官网
  • 管理网站怎么做的看b站视频软件下载安装手机
  • 网站 系统 区别网站搜索引擎优化报告
  • 网站建设测试规划书网站seo在线诊断
  • 做网站推广需要多少费用郑州网络优化实力乐云seo
  • 专门做奶粉的网站优化公司结构
  • qingdao城乡住房建设厅网站百度新闻官网
  • 淮北市城乡建设委员会的网站免费的行情软件网站下载
  • asp企业网站源码下载优化网站排名如何
  • 校园二手交易网站建设方案免费数据分析网站
  • 加强镇政府网站建设的通知中国最大网站排名
  • 怎么改网站标题网站推广优化是什么意思
  • 网站建设的具体流程重大军事新闻最新消息
  • 如何判断网站程序使用asp还是php智慧软文
  • html5浅蓝色网站设计公司dede模板培训心得总结
  • 为什么没人做物流网站今天刚刚发生的新闻最新新闻
  • 车间管理系统搜索引擎优化是什么意思啊
  • 建设银行造价咨询中心网站网络推广的工作好做吗
  • 足球网站怎么做广州营销seo