成都 php 网站建网站要租服务器吗
2026/1/10 2:23:18 网站建设 项目流程
成都 php 网站,建网站要租服务器吗,百度网站排名查询工具,山东环保行业网站开发一、适用场景 适用场景#xff1a;小车差速/定位、微型机械臂关节、门栓/阀门微调、以步进精度做角度控制的低速场合、嵌入式 PWM/GPIO/驱动练习与教学。二、器材清单28BYJ-48 步进电机#xff08;常见 5V 带减速箱#xff09;1ULN2003 驱动板#xff08;或等效达林顿阵列驱…一、适用场景适用场景小车差速/定位、微型机械臂关节、门栓/阀门微调、以步进精度做角度控制的低速场合、嵌入式 PWM/GPIO/驱动练习与教学。二、器材清单28BYJ-48 步进电机常见 5V 带减速箱×1ULN2003 驱动板或等效达林顿阵列驱动×1stm32f103或其它 STM32开发板 ×1稳定 5V 电源电机供电×1若干杜邦线三、工作原理要点电机与减速比28BYJ-48 通常为单极四相步进电机电机本体步距角常为 5.625°电机轴每转需 360 / 5.625 64 步电机带一级减速箱典型标称 64:1因此输出轴每转步数约 64 × 64 4096 步不同厂家有细微差异实际以传动箱标注/测量为准。推导数位检算360 / 5.625 6464 × 64 4096输出角度 360 / 4096 ≈ 0.087890625°/步。驱动方式ULN2003 板是 NPN 达林顿阵列按输入 IN1..IN4 对应线圈缠绕的通电次序做开闭即可驱动。ULN2003 为下拉SINK驱动板子将线圈另一端接到电源正极IN 引脚接高时导通到地流过线圈。板上通常带有反向二极管/保护。常用驱动序列常见有三种序列——单相激励wave drive4 步、双相激励full step4 步但两相同时通电、半步half-step8 步兼顾扭矩和平滑。半步常用于平衡分辨率与扭矩。步进控制思想通过改变步序索引加/减并在步与步之间等待适当延时来产生转速在启动/停止时做加减速ramp可避免漏步。四、接线示意VCC → 5VGND → GND标准库HAL库IN1-4--PA4-7五、示例代码标准库#include stm32f10x.h #include oled.h #include bsp_SysTick.h void emGPIO_Init(void); unsigned int z_step[8]{0x0070,0x0030,0x0050,0x0090,0x00d0,0x00c0,0x00e0,0x0060}; unsigned int f_step[8]{0x0060,0x00e0,0x00c0,0x00d0,0x0090,0x0050,0x0030,0x0070}; int main() { int step0; SysTick_Init(); emGPIO_Init(); while(1) { if(step8) step0; GPIO_Write(GPIOD,z_step[step]); Delay_us(1850); step; } // return 0; } void emGPIO_Init(void) { GPIO_InitTypeDef PD; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE); PD.GPIO_Pin GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7; PD.GPIO_Mode GPIO_Mode_Out_PP; PD.GPIO_Speed GPIO_Speed_50MHz; GPIO_Init(GPIOD, PD); }HAL库/* USER CODE BEGIN Header */ /** ****************************************************************************** * file : main.c * brief : Main program body ****************************************************************************** * attention * * Copyright (c) 2025 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 /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* 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); static void MX_GPIO_Init(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ unsigned int z_step[8]{0x0070,0x0030,0x0050,0x0090,0x00d0,0x00c0,0x00e0,0x0060}; unsigned int f_step[8]{0x0060,0x00e0,0x00c0,0x00d0,0x0090,0x0050,0x0030,0x0070}; int step0; /* 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 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { if(step8) step0; GPIOA-ODR z_step[step]; HAL_Delay(2); step; /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ }六、讲解视频https://www.bilibili.com/video/BV1AkmcB8Ep9/?spm_id_from333.1387.upload.video_card.clickvd_sourcef7dfe1b14f260b9cc3a146d2dbfd0719https://www.bilibili.com/video/BV1pwmcBoEJU/?spm_id_from333.1387.upload.video_card.clickvd_sourcef7dfe1b14f260b9cc3a146d2dbfd0719https://www.bilibili.com/video/BV1pwmcBoE4m/?spm_id_from333.1387.upload.video_card.clickvd_sourcef7dfe1b14f260b9cc3a146d2dbfd0719

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询