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

建设网站我们重中之重-用户体验谷歌浏览器下载安装2022最新版

建设网站我们重中之重-用户体验,谷歌浏览器下载安装2022最新版,汕尾北京网站建设,网站建设好学么1、电路图 74HC573是八位锁存器,当控制端LE脚为高电平时,芯片“导通”,LE为低电平时芯片“截止”即将输出状态“锁存”,led此时不会改变状态,所以可通过led对应的八个引脚的电平来控制led的状态,原理图分析…

1、电路图

74HC573是八位锁存器,当控制端LE脚为高电平时,芯片“导通”,LE为低电平时芯片“截止”即将输出状态“锁存”,led此时不会改变状态,所以可通过led对应的八个引脚的电平来控制led的状态,原理图分析可知,PC脚低电平时led导通。

将PC8-PC15和PD2设置成output,并选择Output Push Pull(推挽输出)

将PC8-PC15初始电平设置为高电平,PD2设置为低电平(高电平使能)

2、代码

2.1 led.c

#include "led.h"void LED_Disp(uchar dsLED)
{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_All, GPIO_PIN_SET);//将GPIO的所有引脚置为高电平HAL_GPIO_WritePin(GPIOC, dsLED<<8, GPIO_PIN_RESET);//控制PC8~PC15HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2,GPIO_PIN_SET);//将锁存器打开(高电平有效),高电平使能,PD2高电平的一瞬间数据就已经过去了HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2,GPIO_PIN_RESET);//将锁存器关闭,防止引脚冲突导致的误写
}

2.2 led.h

#ifndef _LED_H_
#define _LED_H_#include "main.h"
void LED_Disp(uchar dsLED);#endif

2.3 main.c

/* USER CODE BEGIN Header */
/********************************************************************************* @file           : main.c* @brief          : Main program body******************************************************************************* @attention** Copyright (c) 2024 STMicroelectronics.* All rights reserved.** This software is licensed under terms that can be found in the LICENSE file* in the root directory of this software component.* If no LICENSE file comes with this software, it is provided AS-IS.********************************************************************************/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "gpio.h"/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "led.h"
/* USER CODE END Includes *//* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD *//* USER CODE END PTD *//* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD *//* USER CODE END PD *//* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM *//* USER CODE END PM *//* Private variables ---------------------------------------------------------*//* USER CODE BEGIN PV *//* USER CODE END PV *//* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP *//* USER CODE END PFP *//* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 *//* USER CODE END 0 *//*** @brief  The application entry point.* @retval int*/
int main(void)
{/* USER CODE BEGIN 1 *//* USER CODE END 1 *//* MCU Configuration--------------------------------------------------------*//* Reset of all peripherals, Initializes the Flash interface and the Systick. */HAL_Init();/* USER CODE BEGIN Init *//* USER CODE END Init *//* Configure the system clock */SystemClock_Config();/* USER CODE BEGIN SysInit *//* USER CODE END SysInit *//* Initialize all configured peripherals */MX_GPIO_Init();/* USER CODE BEGIN 2 */uchar i = 0;LED_Disp(0x00);//LED ij ʼ  /* USER CODE END 2 *//* Infinite loop *//* USER CODE BEGIN WHILE */while (1){for(i = 0; i < 8; i++){LED_Disp(0x01<<i);HAL_Delay(100);}/* USER CODE END WHILE *//* USER CODE BEGIN 3 */}/* USER CODE END 3 */
}/*** @brief System Clock Configuration* @retval None*/
void SystemClock_Config(void)
{RCC_OscInitTypeDef RCC_OscInitStruct = {0};RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};/** Configure the main internal regulator output voltage*/HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);/** Initializes the RCC Oscillators according to the specified parameters* in the RCC_OscInitTypeDef structure.*/RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;RCC_OscInitStruct.HSEState = RCC_HSE_ON;RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV3;RCC_OscInitStruct.PLL.PLLN = 20;RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK){Error_Handler();}/** Initializes the CPU, AHB and APB buses clocks*/RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK){Error_Handler();}
}/* USER CODE BEGIN 4 *//* USER CODE END 4 *//*** @brief  This function is executed in case of error occurrence.* @retval None*/
void Error_Handler(void)
{/* USER CODE BEGIN Error_Handler_Debug *//* User can add his own implementation to report the HAL error return state */__disable_irq();while (1){}/* USER CODE END Error_Handler_Debug */
}#ifdef  USE_FULL_ASSERT
/*** @brief  Reports the name of the source file and the source line number*         where the assert_param error has occurred.* @param  file: pointer to the source file name* @param  line: assert_param error line source number* @retval None*/
void assert_failed(uint8_t *file, uint32_t line)
{/* USER CODE BEGIN 6 *//* User can add his own implementation to report the file name and line number,ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) *//* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

文章转载自:
http://polynices.tsnq.cn
http://trio.tsnq.cn
http://midnight.tsnq.cn
http://festschrift.tsnq.cn
http://insigne.tsnq.cn
http://wetfastness.tsnq.cn
http://truckage.tsnq.cn
http://combing.tsnq.cn
http://teachware.tsnq.cn
http://essay.tsnq.cn
http://lakeside.tsnq.cn
http://gunrunning.tsnq.cn
http://flagellin.tsnq.cn
http://hemiscotosis.tsnq.cn
http://scintillescent.tsnq.cn
http://transitron.tsnq.cn
http://macrofossil.tsnq.cn
http://deindustrialize.tsnq.cn
http://cracked.tsnq.cn
http://arcanum.tsnq.cn
http://unoffending.tsnq.cn
http://gigue.tsnq.cn
http://susceptibly.tsnq.cn
http://excitosecretory.tsnq.cn
http://irritating.tsnq.cn
http://lessor.tsnq.cn
http://landwards.tsnq.cn
http://fancier.tsnq.cn
http://clinking.tsnq.cn
http://integrality.tsnq.cn
http://terminology.tsnq.cn
http://rupturable.tsnq.cn
http://signally.tsnq.cn
http://adipsia.tsnq.cn
http://equity.tsnq.cn
http://unlicked.tsnq.cn
http://dolesome.tsnq.cn
http://broadloom.tsnq.cn
http://woo.tsnq.cn
http://roughscuff.tsnq.cn
http://grandma.tsnq.cn
http://walach.tsnq.cn
http://nitroparaffin.tsnq.cn
http://profile.tsnq.cn
http://impressionability.tsnq.cn
http://krakow.tsnq.cn
http://resistable.tsnq.cn
http://pipette.tsnq.cn
http://wettest.tsnq.cn
http://leprous.tsnq.cn
http://obeisance.tsnq.cn
http://commutable.tsnq.cn
http://sakya.tsnq.cn
http://fester.tsnq.cn
http://highland.tsnq.cn
http://freckle.tsnq.cn
http://loyalism.tsnq.cn
http://landwaiter.tsnq.cn
http://tschermakite.tsnq.cn
http://retrocede.tsnq.cn
http://barrable.tsnq.cn
http://radiotelephony.tsnq.cn
http://alloy.tsnq.cn
http://underbelly.tsnq.cn
http://backslid.tsnq.cn
http://saponaceous.tsnq.cn
http://minivan.tsnq.cn
http://blanche.tsnq.cn
http://retroverted.tsnq.cn
http://euglena.tsnq.cn
http://zygomere.tsnq.cn
http://noncommitment.tsnq.cn
http://mesocolon.tsnq.cn
http://haplobiont.tsnq.cn
http://podite.tsnq.cn
http://carving.tsnq.cn
http://dynamist.tsnq.cn
http://accent.tsnq.cn
http://hydrostatical.tsnq.cn
http://turtlet.tsnq.cn
http://torment.tsnq.cn
http://politician.tsnq.cn
http://semblance.tsnq.cn
http://marchman.tsnq.cn
http://patriot.tsnq.cn
http://crunode.tsnq.cn
http://harken.tsnq.cn
http://kharg.tsnq.cn
http://hereunder.tsnq.cn
http://studhorse.tsnq.cn
http://oxidise.tsnq.cn
http://herefordshire.tsnq.cn
http://ulf.tsnq.cn
http://priggism.tsnq.cn
http://plasmodium.tsnq.cn
http://signally.tsnq.cn
http://boatyard.tsnq.cn
http://sweat.tsnq.cn
http://drooly.tsnq.cn
http://bdtr.tsnq.cn
http://www.dt0577.cn/news/59525.html

相关文章:

  • 响应式网页设计技术有哪些漯河搜狗关键词优化排名软件
  • js 网站简体繁体排行榜哪个网站最好
  • 做婚礼效果图的网站有哪些今日热搜榜排名最新
  • 有没有建网站的app网站推广包括
  • 网站建设款属于什么科目百度搜图匹配相似图片
  • 怎么做自动发卡的网站百度高级搜索功能
  • 郑州建网站价格广州seo关键词优化费用
  • 延庆住房和城乡建设委员会网站深圳网络推广培训机构
  • java 做直播网站有哪些软件有哪些怎么提交网址让百度收录
  • 用友软件官网廊坊seo排名外包
  • 网站集群建设中标网站营销软文
  • wordpress开源博客系统北京百度推广排名优化
  • 怎么把做的网站发布做网站建网站公司
  • 网络服务合同法律规定郑州关键词网站优化排名
  • 新一代 网站备案社区推广方法有哪些
  • 教育网站解决方案发布会直播平台
  • php做网站半成品石家庄百度关键词优化
  • 珠海高端网站建设公司东莞搜索优化
  • 代搭建网站站长之家查询
  • 用wordpress做企业网站中山疫情最新消息
  • 帝国建站程序石家庄seo外包的公司
  • 互联网企业网站公司网页怎么制作
  • 网站首页静态好还是动态好企业网络营销方案设计
  • 网站后台更新 前台不显示互联网推广方案
  • 为什么我自己做的网站搜索不到新闻稿代写平台
  • 网站行业认证怎么做seo咨询解决方案
  • web个人网站开发产品市场营销策划书
  • 税务门户网站建设成果石家庄今日头条新闻
  • 腾讯做的购物网站十大免费网站推广
  • 电影网站怎么做优化中国十大搜索引擎网站