芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密

飞芯科技提供芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密逆向服务

PCB抄板stm32f103的蓝牙开关控制舵机

  1. PCB抄板#include "stm32f10x.h"
  2. PCB抄板#include "usart1.h"
  3. PCB抄板#include "bluetooth.h"
  4. #include "key.h"
  5. #include "led.h"
  6. #include "motor.h"
  7. #include "runmodel.h"

  8. u8 motor_mode = 0;               //电机运动模式
  9. u8 send_flag = 0;

  10. int main(void)
  11. {        
  12.                 NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);                         //中断控制器分组设置
  13.                 Key_Init();                                                                                                            //初始化按键
  14.                 EXTI_Configuration();
  15.                 Usart1_Init(115200);                                                                   //设置串口1的波特率为115200bit
  16.                 LedInit();                                                                                                    //初始化led
  17.                 Delay_Init();                                                                                                 //初始化延迟函数
  18.                 BlueTooth_Init();                                                                                //初始化蓝牙模块
  19.                 USART_Cmd(USART1, ENABLE);                                                                                                         //除能串口
  20.                 GPIO_ResetBits(GPIOB,EN);
  21.                 Motor_Init();                                                                                                                                                                //舵机初始化
  22.                 Lo_Signal;
  23.                 while(1)
  24.                 {
  25.                         if(GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_8) == Bit_RESET)
  26.                         {
  27.                                 DelayMs(100);
  28.                                 if(GPIO_ReadInputDataBit(GPIOB,GPIO_Pin_8) == Bit_RESET)
  29.                                 {
  30.                                         send_flag++;
  31.                                         if(send_flag == 2)
  32.                                                 send_flag = 0;
  33.                                         if(GPIO_ReadOutputDataBit(GPIOA,GPIO_Pin_2) == Bit_RESET)
  34.                                                 GPIO_SetBits(GPIOA,GPIO_Pin_2);        
  35.                                         else
  36.                                                 GPIO_ResetBits(GPIOA,GPIO_Pin_2);        
  37.                                        
  38.                                         if(send_flag == 1)
  39.                                         {
  40.                                                 Motor_Mode(Reverse_45);
  41.                                         }
  42.                                        
  43.                                         if(send_flag == 0)
  44.                                         {
  45.                                                 Motor_Mode(Forward_45);
  46.                                         }
  47.                                 }
  48.                         }
  49.                         
  50.                 }
  51. }



联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.taihedz.cn
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信