这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » DIY与开源设计 » 电子DIY » 上传两个官方例程

共3条 1/1 1 跳转至

上传两个官方例程

菜鸟
2024-04-13 21:49:34     打赏


例程1、

led2 闪烁


led_shansuo.zip


例程2、

串口3 printf打印


chuankou3.zip


led2 闪烁视频

电子产品世界《得捷手势翻页笔活动》 STM32H503RB开发板 官方例程闪烁led2_哔哩哔哩_bilibili


串口3官方例程修改,打印图片

无标题.jpg

首先对  MX_GPIO_Init();进行io口的配置

再在while(1)循环里面添加    HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);

进行led2的翻转

int main(void)

{

  /* USER CODE BEGIN 1 */


  /* STM32H5xx HAL library initialization:

       - Systick timer is configured by default as source of time base, but user

             can eventually implement his proper time base source (a general purpose

             timer for example or other time source), keeping in mind that Time base

             duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and

             handled in milliseconds basis.

       - Set NVIC Group Priority to 4

       - Low Level Initialization

     */

  /* 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 */

  /* Initialize BSP Led for LED2 */

  BSP_LED_Init(LED2);

  /* USER CODE END SysInit */


  /* Initialize all configured peripherals */

  MX_GPIO_Init();

  MX_ICACHE_Init();

  MX_USART3_UART_Init();

  /* USER CODE BEGIN 2 */


  /* Output a message on Hyperterminal using printf function */



  /* USER CODE END 2 */


  /* Infinite loop */

  /* USER CODE BEGIN WHILE */

  while (1)

  {

    /* USER CODE END WHILE */


    /* USER CODE BEGIN 3 */

    HAL_GPIO_TogglePin(LED2_GPIO_PORT, LED2_PIN);

printf("\n\rHello EEPW & DigiKey! Hello STM32H503!\n\r");

    /* Insert delay 100 ms */

    HAL_Delay(1000);

  }

  /* USER CODE END 3 */

}



助工
2024-05-15 00:51:03     打赏
2楼

不愧是大佬


院士
2024-05-15 11:07:11     打赏
3楼

谢谢分享。


共3条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]