0


开源!自制一个桌面宠物(STM32CUBEMX HAL库 PWM波 小项目)

原视频:好,自制一个桌面宠物!_哔哩哔哩_bilibili
基础所需:基础电路认识,C语言,STM32开发,CUBEMX和Keil开发(重要),一点点艺术细胞。
CAUTION:本文重点在代码部分的开源,是基于HAL库。硬件手工部分不出教程(没必要)可以直接看视频P2。

硬件配置

主控:STM32F103C8T6 粉色沉金板

舵机:SG90 *4

屏幕:1.3寸OLED (IIC驱动)

供电:锂电池 (3.7V 800mah) + 锂电池充放电模块(不会自动断电,适配3.7V锂电池)

蓝牙:低功耗蓝牙(BLE,串口透传,便宜又好用)

软件配置:

手机app开发:appinventor制作(这里不附教程,因为我也不熟,唯一有用的建议是蓝牙模组要用BLE而不是普通蓝牙,需另外下载并配置,建议另寻他佬教程

单片机开发:

平台:STM32CUBEIDE(等效STM32CUBEMX+Keil)

提纲

1.定时器pwm波输出

2.串口信息交互

**3.OLED显示 **

CUBEMX配置:

(这里没有配置驱动屏幕的IIC,选择直接软件模拟,文末会附驱动代码。

1.RCC时钟配置:

(无脑选择外部时钟,无脑拉最高频。

2.定时器配置PWM输出模式:

(一个定时器直接开四个PWM通道即可,并关注输出引脚是否正确。根据舵机参数,配置PWM频率为50Hz。

3.配置串口

(也很无脑,但要根据蓝牙模块的参数配置传输速率(Baud Rate),我是115200。

并且开中断NVIC,优先级按经验来填2就可。

4.小Tip:

经验所得,把系统滴答时钟的优先级拉最高可以防止卡死在HAL_Delay里面。

5.最后生成工程,用keil的这里改成MDK_ARM

推荐打勾这个,为每个外设建.c和.h文件,使工程结构更清晰。

最后点Generate code建立工程(stm32cubeide直接ctrl+s保存即可)

代码部分:(最后会附完整代码,其中LED的控制可有可无。

1.PWM波输出(姿态
uint16_t angle(uint8_t angle) //角度CCR值转换
{
    return angle*2000/180+500;
}

void Rbt_Init(void) //立正
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(100);
}

void move_forward(void) //前进
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));

    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
}

void move_behind(void) //后退
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));

    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
}

void move_right(void) //右转
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    HAL_Delay(move_delay);
}

void move_left(void) //左转
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
}

void move_swing(void) //摇摆
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(130));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(130));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(50));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(50));
    HAL_Delay(250);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(50));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(50));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(130));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(130));
    HAL_Delay(250);
}

void move_stretch(void){ //伸懒腰+坐下招手
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    if(TIM2->CCR1<angle(155) && TIM2->CCR3>angle(25)){
        for(uint8_t i=0;i<70;i++){       //循环算法,可以减慢舵机运转速度
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90+i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90-i));
            HAL_Delay(move_speed);
        }
        HAL_Delay(1000);
        for(uint8_t i=0;i<70;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(160-i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(20+i));
            HAL_Delay(move_speed);
        }
        for(uint8_t i=0;i<65;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90+i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90-i));
            HAL_Delay(move_speed);
        }
        for(uint8_t i=0;i<20;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90-i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90+i));
            HAL_Delay(move_speed);
        }
        HAL_Delay(1000);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(140));
        HAL_Delay(1000);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(178));
        HAL_Delay(500);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(140));
        HAL_Delay(500);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(178));
        HAL_Delay(500);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(140));
        HAL_Delay(500);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(70));
    }
}

void move_sleep(void){ //睡眠
    if(TIM2->CCR3<angle(160) && TIM2->CCR1>angle(20)){
        for(uint8_t i=0;i<75;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90-i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90+i));
            HAL_Delay(move_speed);
        }
    }
    if(TIM2->CCR2<angle(160) && TIM2->CCR4>angle(20)){
        for(uint8_t i=0;i<75;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90+i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90-i));
            HAL_Delay(move_speed);
        }
    }

}
2. 串口接收

(采用中断

while前开一下

HAL_UART_Receive_IT(&huart1, &move_mode, 1);

中断回调函数(用来切换表情,然后再开启中断接收(不然后面会接收不到)

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
    //重新设置中断
    if(move_mode == 8){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP2);//前进脸
    }
    else if(move_mode == 2){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP2);//后退脸
    }
    else if(move_mode == 4){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP4);//左转脸
    }
    else if(move_mode == 6){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP3);//右转脸
    }
    else if(move_mode == 'A'){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP2);//摇摆脸
    }

    HAL_UART_Receive_IT(&huart1, &move_mode, 1); //再次开启中断接收
}
3.主函数内while循环(运行当前动作
while (1)
  {
      if(move_mode == 8){//前进
          move_forward();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 2){//后退
          move_behind();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 4){//左转
          move_left();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 6){//右转
          move_right();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 5 || move_mode == 'C'){//立正
          OLED_DrawBMP(0,0,128,8,BMP1);
          Rbt_Init();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 'A'){//摇摆
          move_swing();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 'B'){//坐下
          if(flag==0){
              OLED_DrawBMP(0,0,128,8,BMP2);
              move_stretch();
              OLED_DrawBMP(0,0,128,8,BMP5);
              HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
              flag=1;
          }
      }
      else if(move_mode == 'D'){//睡觉
          if(flag==0){
              move_sleep();
              OLED_DrawBMP(0,0,128,8,BMP6);
              flag=1;
          }
      }
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
  }

main文件全部代码:


/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "tim.h"
#include "usart.h"
#include "gpio.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include <stdio.h>
#include "oled.h"
#include "bmp.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 */
uint8_t move_mode = 0;
uint8_t flag = 0;
#define move_delay 150 //一般动作调速
#define move_speed 4 //慢速动作调速
/* USER CODE END PV */

/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
/* USER CODE BEGIN PFP */
void Rbt_Init(void);
uint16_t angle(uint8_t angle);
void move_forward(void);
void move_behind(void);
void move_right(void);
void move_left(void);
void move_swing(void);
void move_stretch(void);
void move_test(void);
void move_sleep(void);
/* USER CODE END PFP */

/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
    //重新设置中断
    if(move_mode == 8){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP2);//前进脸
    }
    else if(move_mode == 2){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP2);//后退脸
    }
    else if(move_mode == 4){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP4);//左转脸
    }
    else if(move_mode == 6){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP3);//右转脸
    }
    else if(move_mode == 'A'){
        OLED_Clear();
        OLED_DrawBMP(0,0,128,8,BMP2);//摇摆脸
    }

    HAL_UART_Receive_IT(&huart1, &move_mode, 1);
}

/* 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();
  MX_USART1_UART_Init();
  MX_TIM2_Init();
  /* USER CODE BEGIN 2 */

  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);//开启PWM输出
  HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_2);
  HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_3);
  HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_4);
  HAL_UART_Receive_IT(&huart1, &move_mode, 1);//开启中断接收
  OLED_Init();//屏幕初始化
  OLED_Clear();
  OLED_DrawBMP(0,0,128,8,BMP6);//立正脸
  while (1)
  {
      /*__HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(120));
     HAL_Delay(1);*/
      if(move_mode == 8){//前进
          move_forward();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 2){//后退
          move_behind();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 4){//左转
          move_left();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 6){//右转
          move_right();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 5 || move_mode == 'C'){//立正
          OLED_DrawBMP(0,0,128,8,BMP1);
          Rbt_Init();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 'A'){//摇摆
          move_swing();
          HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
          flag=0;
      }
      else if(move_mode == 'B'){//坐下
          if(flag==0){
              OLED_DrawBMP(0,0,128,8,BMP2);
              move_stretch();
              OLED_DrawBMP(0,0,128,8,BMP5);
              HAL_GPIO_TogglePin(LED0_GPIO_Port, LED0_Pin);
              flag=1;
          }
      }
      else if(move_mode == 'D'){//睡觉
          if(flag==0){
              move_sleep();
              OLED_DrawBMP(0,0,128,8,BMP6);
              flag=1;
          }
      }
    /* 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};

  /** 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.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
  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_DIV2;
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;

  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
  {
    Error_Handler();
  }
}

/* USER CODE BEGIN 4 */
void Rbt_Init(void)
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(100);
}
uint16_t angle(uint8_t angle)
{
    return angle*2000/180+500;
}
void move_forward(void)
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));

    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
}

void move_behind(void)
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));

    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
}

void move_right(void)
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    HAL_Delay(move_delay);
}

void move_left(void)
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(135));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(135));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(45));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(45));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    HAL_Delay(move_delay);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    HAL_Delay(move_delay);
}

void move_swing(void)
{
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(130));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(130));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(50));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(50));
    HAL_Delay(200);
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(50));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(50));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(130));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(130));
    HAL_Delay(200);
}

void move_stretch(void){
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90));
    __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90));
    if(TIM2->CCR1<angle(155) && TIM2->CCR3>angle(25)){
        for(uint8_t i=0;i<70;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90+i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90-i));
            HAL_Delay(move_speed);
        }
        HAL_Delay(1000);
        for(uint8_t i=0;i<70;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(160-i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(20+i));
            HAL_Delay(move_speed);
        }
        for(uint8_t i=0;i<65;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90+i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90-i));
            HAL_Delay(move_speed);
        }
        for(uint8_t i=0;i<20;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90-i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90+i));
            HAL_Delay(move_speed);
        }
        HAL_Delay(1000);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(140));
        HAL_Delay(1000);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(178));
        HAL_Delay(500);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(140));
        HAL_Delay(500);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(178));
        HAL_Delay(500);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(140));
        HAL_Delay(500);
        __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(70));
    }
}

void move_sleep(void){
    if(TIM2->CCR3<angle(160) && TIM2->CCR1>angle(20)){
        for(uint8_t i=0;i<75;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_1,angle(90-i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_3,angle(90+i));
            HAL_Delay(move_speed);
        }
    }
    if(TIM2->CCR2<angle(160) && TIM2->CCR4>angle(20)){
        for(uint8_t i=0;i<75;i++){
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_2,angle(90+i));
            __HAL_TIM_SetCompare(&htim2, TIM_CHANNEL_4,angle(90-i));
            HAL_Delay(move_speed);
        }
    }

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

最后附OLED驱动(评价是不如去参考别人的

1.oled.c


#include "oled.h"
//#include "stdlib.h"
#include "oledfont.h"       
#include "main.h"

void IIC_Start()
{

    OLED_SCLK_Set() ;
    OLED_SDIN_Set();
    OLED_SDIN_Clr();
    OLED_SCLK_Clr();
}

/**********************************************
//IIC Stop
**********************************************/
void IIC_Stop()
{

    OLED_SCLK_Clr();
    OLED_SDIN_Clr();
    OLED_SDIN_Set();
    OLED_SCLK_Set() ;
}
/**********************************************
// IIC Write byte
**********************************************/

void Write_IIC_Byte(unsigned char IIC_Byte)
{
    unsigned char i;
    unsigned char m,da;
    da=IIC_Byte;
    for(i=0;i<8;i++)        
    {
            m=da;
            OLED_SCLK_Clr();
        m=m&0x80;
        if(m==0x80)
        {OLED_SDIN_Set();}
        else OLED_SDIN_Clr();
            da=da<<1;
        OLED_SCLK_Set();
        }

    OLED_SCLK_Clr();
    OLED_SCLK_Set() ;
}
/**********************************************
// IIC Write Command
**********************************************/
void Write_IIC_Command(unsigned char IIC_Command)
{
   IIC_Start();
   Write_IIC_Byte(0x78);            //Slave address,SA0=0
   Write_IIC_Byte(0x00);            //write command
   Write_IIC_Byte(IIC_Command); 
   IIC_Stop();
}
/**********************************************
// IIC Write Data
**********************************************/
void Write_IIC_Data(unsigned char IIC_Data)
{
   IIC_Start();
   Write_IIC_Byte(0x78);            //D/C#=0; R/W#=0
   Write_IIC_Byte(0x40);            //write data
   Write_IIC_Byte(IIC_Data);
   IIC_Stop();
}
void OLED_WR_Byte(unsigned dat,unsigned cmd)
{
    if(cmd)
            {
   IIC_Start();
   Write_IIC_Byte(0x78);            //D/C#=0; R/W#=0
   Write_IIC_Byte(0x40);            //write data
   Write_IIC_Byte(dat);
   IIC_Stop();
        }
    else {
        IIC_Start();
   Write_IIC_Byte(0x78);            //Slave address,SA0=0
   Write_IIC_Byte(0x00);            //write command
   Write_IIC_Byte(dat); 
   IIC_Stop();
        
    }

}

/********************************************
// fill_Picture
********************************************/
void fill_picture(unsigned char fill_Data)
{
    unsigned char m,n;
    for(m=0;m<8;m++)
    {
        OLED_WR_Byte(0xb0+m,0);        //page0-page1
        OLED_WR_Byte(0x00,0);        //low column start address
        OLED_WR_Byte(0x10,0);        //high column start address
        for(n=0;n<128;n++)
            {
                OLED_WR_Byte(fill_Data,1);
            }
    }
}

/***********************Delay****************************************/
/*void Delay_50ms(unsigned int Del_50ms)
{
    unsigned int m;
    for(;Del_50ms>0;Del_50ms--)
        for(m=6245;m>0;m--);
}

void Delay_1ms(unsigned int Del_1ms)
{
    unsigned char j;
    while(Del_1ms--)
    {    
        for(j=0;j<123;j++);
    }
}*/

//��������

    void OLED_Set_Pos(unsigned char x, unsigned char y) 
{     OLED_WR_Byte(0xb0+y,OLED_CMD);
    OLED_WR_Byte(((x&0xf0)>>4)|0x10,OLED_CMD);
    OLED_WR_Byte((x&0x0f)|0x01,OLED_CMD); 
}         
//����OLED��ʾ    
void OLED_Display_On(void)
{
    OLED_WR_Byte(0X8D,OLED_CMD);  //SET DCDC����
    OLED_WR_Byte(0X14,OLED_CMD);  //DCDC ON
    OLED_WR_Byte(0XAF,OLED_CMD);  //DISPLAY ON
}
//�ر�OLED��ʾ     
void OLED_Display_Off(void)
{
    OLED_WR_Byte(0X8D,OLED_CMD);  //SET DCDC����
    OLED_WR_Byte(0X10,OLED_CMD);  //DCDC OFF
    OLED_WR_Byte(0XAE,OLED_CMD);  //DISPLAY OFF
}                        
//��������,������,������Ļ�Ǻ�ɫ��!��û����һ��!!!      
void OLED_Clear(void)  
{  
    uint8_t i,n;
    for(i=0;i<8;i++)  
    {  
        OLED_WR_Byte (0xb0+i,OLED_CMD);    //����ҳ��ַ��0~7��
        OLED_WR_Byte (0x02,OLED_CMD);      //������ʾλ�á��е͵�ַ
        OLED_WR_Byte (0x10,OLED_CMD);      //������ʾλ�á��иߵ�ַ   
        for(n=0;n<128;n++)OLED_WR_Byte(0,OLED_DATA); 
    } //������ʾ
}

void OLED_On(void)  
{  
    uint8_t i,n;
    for(i=0;i<8;i++)  
    {  
        OLED_WR_Byte (0xb0+i,OLED_CMD);    //����ҳ��ַ��0~7��
        OLED_WR_Byte (0x02,OLED_CMD);      //������ʾλ�á��е͵�ַ
        OLED_WR_Byte (0x10,OLED_CMD);      //������ʾλ�á��иߵ�ַ   
        for(n=0;n<128;n++)OLED_WR_Byte(1,OLED_DATA); 
    } //������ʾ
}
//��ָ��λ����ʾһ���ַ�,���������ַ�
//x:0~127
//y:0~63
//mode:0,������ʾ;1,������ʾ                 
//size:ѡ������ 16/12 
void OLED_ShowChar(uint8_t x,uint8_t y,uint8_t chr,uint8_t Char_Size)
{          
    unsigned char c=0,i=0;    
        c=chr-' ';//�õ�ƫ�ƺ��ֵ            
        if(x>Max_Column-1){x=0;y=y+2;}
        if(Char_Size ==16)
            {
            OLED_Set_Pos(x,y);    
            for(i=0;i<8;i++)
            OLED_WR_Byte(F8X16[c*16+i],OLED_DATA);
            OLED_Set_Pos(x,y+1);
            for(i=0;i<8;i++)
            OLED_WR_Byte(F8X16[c*16+i+8],OLED_DATA);
            }
            else {    
                OLED_Set_Pos(x,y);
                for(i=0;i<6;i++)
                OLED_WR_Byte(F6x8[c][i],OLED_DATA);
                
            }
}
//m^n����
uint32_t oled_pow(uint8_t m,uint8_t n)
{
    uint32_t result=1;
    while(n--)result*=m;    
    return result;
}                  
//��ʾ2������
//x,y :�������     
//len :���ֵ�λ��
//size:�����С
//mode:ģʽ    0,���ģʽ;1,����ģʽ
//num:��ֵ(0~4294967295);               
void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size2)
{             
    uint8_t t,temp;
    uint8_t enshow=0;
    for(t=0;t<len;t++)
    {
        temp=(num/oled_pow(10,len-t-1))%10;
        if(enshow==0&&t<(len-1))
        {
            if(temp==0)
            {
                OLED_ShowChar(x+(size2/2)*t,y,' ',size2);
                continue;
            }else enshow=1; 
              
        }
         OLED_ShowChar(x+(size2/2)*t,y,temp+'0',size2); 
    }
} 
//��ʾһ���ַ��Ŵ�
void OLED_ShowString(uint8_t x,uint8_t y,uint8_t *chr,uint8_t Char_Size)
{
    unsigned char j=0;
    while (chr[j]!='\0')
    {        OLED_ShowChar(x,y,chr[j],Char_Size);
            x+=8;
        if(x>120){x=0;y+=2;}
            j++;
    }
}
//��ʾ����
void OLED_ShowCHinese(uint8_t x,uint8_t y,uint8_t no)
{                      
    uint8_t t,adder=0;
    OLED_Set_Pos(x,y);
    for(t=0;t<16;t++)
        {
                OLED_WR_Byte(Hzk[2*no][t],OLED_DATA);
                adder+=1;
     }    
        OLED_Set_Pos(x,y+1);    
    for(t=0;t<16;t++)
            {    
                OLED_WR_Byte(Hzk[2*no+1][t],OLED_DATA);
                adder+=1;
      }                    
}
/***********������������ʾ��ʾBMPͼƬ128��64��ʼ������(x,y),x�ķ�Χ0��127��yΪҳ�ķ�Χ0��7*****************/
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[])
{     
 unsigned int j=0;
 unsigned char x,y;
  
  if(y1%8==0) y=y1/8;      
  else y=y1/8+1;
    for(y=y0;y<y1;y++)
    {
        OLED_Set_Pos(x0,y);
    for(x=x0;x<x1;x++)
        {      
            OLED_WR_Byte(BMP[j++],OLED_DATA);            
        }
    }
} 

//��ʼ��SSD1306                        
void OLED_Init(void)
{     
 
      
//     GPIO_InitTypeDef  GPIO_InitStructure;
//
//     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOD|RCC_APB2Periph_GPIOG, ENABLE);     //ʹ��PC,D,G�˿�ʱ��
//
//    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_3|GPIO_Pin_8;     //PD3,PD6�������
//     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;          //�������
//    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;//�ٶ�50MHz
//     GPIO_Init(GPIOD, &GPIO_InitStructure);      //��ʼ��GPIOD3,6
//     GPIO_SetBits(GPIOD,GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_3|GPIO_Pin_8);    //PD3,PD6 �����

// #if OLED_MODE==1
//
//     GPIO_InitStructure.GPIO_Pin =0xFF; //PC0~7 OUT�������
//     GPIO_Init(GPIOC, &GPIO_InitStructure);
//     GPIO_SetBits(GPIOC,0xFF); //PC0~7�����
//
//     GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15;                 //PG13,14,15 OUT�������
//     GPIO_Init(GPIOG, &GPIO_InitStructure);
//     GPIO_SetBits(GPIOG,GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15);                         //PG13,14,15 OUT  �����
//
// #else
//     GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1;                 //PC0,1 OUT�������
//     GPIO_Init(GPIOC, &GPIO_InitStructure);
//     GPIO_SetBits(GPIOC,GPIO_Pin_0|GPIO_Pin_1);                         //PC0,1 OUT  �����
//
//    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;                 //PG15 OUT�������      RST
//     GPIO_Init(GPIOG, &GPIO_InitStructure);
//     GPIO_SetBits(GPIOG,GPIO_Pin_15);                         //PG15 OUT  �����
//
//
// #endif

OLED_WR_Byte(0xAE,OLED_CMD);//--display off
    OLED_WR_Byte(0x02,OLED_CMD);//---set low column address
    OLED_WR_Byte(0x10,OLED_CMD);//---set high column address
    OLED_WR_Byte(0x40,OLED_CMD);//--set start line address  
    OLED_WR_Byte(0xB0,OLED_CMD);//--set page address
    OLED_WR_Byte(0x81,OLED_CMD); // contract control
    OLED_WR_Byte(0xFF,OLED_CMD);//--128   
    OLED_WR_Byte(0xA1,OLED_CMD);//set segment remap 
    OLED_WR_Byte(0xA6,OLED_CMD);//--normal / reverse
    OLED_WR_Byte(0xA8,OLED_CMD);//--set multiplex ratio(1 to 64)
    OLED_WR_Byte(0x3F,OLED_CMD);//--1/64 duty
    OLED_WR_Byte(0xAD,OLED_CMD);//set charge pump enable
    OLED_WR_Byte(0x8B,OLED_CMD);//-0x8B �ڹ� VCC
    OLED_WR_Byte(0x33,OLED_CMD);//-0X30---0X33 set VPP 9V
    OLED_WR_Byte(0xC8,OLED_CMD);//Com scan direction
    OLED_WR_Byte(0xD3,OLED_CMD);//-set display offset
    OLED_WR_Byte(0x00,OLED_CMD);//
    
    OLED_WR_Byte(0xD5,OLED_CMD);//set osc division
    OLED_WR_Byte(0x80,OLED_CMD);//
    
    OLED_WR_Byte(0xD8,OLED_CMD);//set area color mode off
    OLED_WR_Byte(0x05,OLED_CMD);//
    
    OLED_WR_Byte(0xD9,OLED_CMD);//Set Pre-Charge Period
    OLED_WR_Byte(0x1F,OLED_CMD);//
    
    OLED_WR_Byte(0xDA,OLED_CMD);//set com pin configuartion
    OLED_WR_Byte(0x12,OLED_CMD);//
    
    OLED_WR_Byte(0xDB,OLED_CMD);//set Vcomh
    OLED_WR_Byte(0x40,OLED_CMD);//
    
    
    OLED_WR_Byte(0xAF,OLED_CMD);//--turn on oled panel
}  

2.oled.h

#ifndef __OLED_H
#define __OLED_H
#include "main.h"
#include "stdlib.h"
//#include "gpio.h"
#define OLED_MODE 0
#define SIZE 8
#define XLevelL        0x00
#define XLevelH        0x10
#define Max_Column    128
#define Max_Row        64
#define    Brightness    0xFF 
#define X_WIDTH     128
#define Y_WIDTH     64                                  
//-----------------OLED IIC�˿ڶ���----------------                         

#define OLED_SCLK_Clr() HAL_GPIO_WritePin(SCL_GPIO_Port,SCL_Pin,GPIO_PIN_RESET)//SCL IIC�ӿڵ�ʱ���ź�
#define OLED_SCLK_Set() HAL_GPIO_WritePin(SCL_GPIO_Port,SCL_Pin,GPIO_PIN_SET)

#define OLED_SDIN_Clr() HAL_GPIO_WritePin(SDA_GPIO_Port,SDA_Pin,GPIO_PIN_RESET)//SDA IIC�ӿڵ������ź�
#define OLED_SDIN_Set() HAL_GPIO_WritePin(SDA_GPIO_Port,SDA_Pin,GPIO_PIN_SET)

              
#define OLED_CMD  0    //���
#define OLED_DATA 1    //���

//OLED�����ú���
void OLED_WR_Byte(unsigned dat,unsigned cmd);  
void OLED_Display_On(void);
void OLED_Display_Off(void);                                                  
void OLED_Init(void);
void OLED_Clear(void);
void OLED_DrawPoint(uint8_t x,uint8_t y,uint8_t t);
void OLED_Fill(uint8_t x1,uint8_t y1,uint8_t x2,uint8_t y2,uint8_t dot);
void OLED_ShowChar(uint8_t x,uint8_t y,uint8_t chr,uint8_t Char_Size);
void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size);
void OLED_ShowString(uint8_t x,uint8_t y, uint8_t *p,uint8_t Char_Size);
void OLED_Set_Pos(unsigned char x, unsigned char y);
void OLED_ShowCHinese(uint8_t x,uint8_t y,uint8_t no);
void OLED_DrawBMP(unsigned char x0, unsigned char y0,unsigned char x1, unsigned char y1,unsigned char BMP[]);
void Delay_50ms(unsigned int Del_50ms);
void Delay_1ms(unsigned int Del_1ms);
void fill_picture(unsigned char fill_Data);
void Picture();
void IIC_Start();
void IIC_Stop();
void Write_IIC_Command(unsigned char IIC_Command);
void Write_IIC_Data(unsigned char IIC_Data);
void Write_IIC_Byte(unsigned char IIC_Byte);

#endif  
     

3.bmp(表情的模

#ifndef __BMP_H
#define __BMP_H
unsigned char BMP1[] = //立正脸
        {
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,
                0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF8,0xFE,0xFF,0xFF,0xFF,0xFF,
                0xFF,0xFF,0xFF,0xFE,0xF8,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF8,0xFE,0xFF,0xFF,
                0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xF8,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
                0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,
                0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
                0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,
                0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,
                0xFF,0xFF,0xFF,0xFF,0x3F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x3F,0xFF,0xFF,0xFF,
                0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,
                0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
                0x03,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C:\Users\zjyhuoer\Desktop\1.bmp",0*/
                /* (128 X 64 )*/
        };

unsigned char BMP2[] = //前进脸
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0xFF,0xFF,0xFE,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xF0,0xE0,0xE0,0xC0,0xC0,
                0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x80,0x80,0xC0,0xC0,0xE0,0xE0,0xF0,0xF0,0xF8,0xF8,0xFC,0xFC,0xFE,0xFE,0xFF,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x03,0x03,0x07,0x07,0x0F,0x0F,0x1F,0x1F,0x1F,
                0x3F,0x3F,0x7F,0x7F,0xFE,0xFE,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xF0,0xE0,0xE0,0xC0,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0xC0,0xC0,0xE0,0xE0,0xF0,0xF0,0xF8,0xF8,0xFC,0xFC,0xFE,0xFE,0x7F,0x7F,
                0x3F,0x3F,0x3F,0x1F,0x1F,0x0F,0x0F,0x07,0x07,0x03,0x03,0x03,0x01,0x01,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0xC0,0xC0,0xE0,0xE0,0xF0,0xF0,0xF0,
                0xF8,0xF8,0xFC,0xFC,0xFC,0xFE,0xFF,0x7F,0x7F,0x3F,0x3F,0x1F,0x1F,0x0F,0x0F,0x07,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x0F,0x0F,0x1F,0x1F,0x3F,0x3F,0x7F,0x7F,0xFF,0xFF,0xFC,0xFC,0xFC,0xF8,
                0xF8,0xF0,0xF0,0xE0,0xE0,0xE0,0xC0,0xC0,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0xFE,0xFE,0xFF,0x7F,0x7F,0x7F,0x3F,0x3F,0x1F,0x1F,0x0F,0x0F,0x07,0x07,
                0x03,0x03,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x03,0x03,
                0x03,0x07,0x07,0x0F,0x0F,0x1F,0x1F,0x3F,0x3F,0x7F,0x7F,0xFF,0xFF,0xFE,0xFE,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C:\Users\zjyhuoer\Desktop\2.2.bmp",0*/
        };

unsigned char BMP3[] ={//左转脸

        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x80,0x80,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x80,0x80,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x01,0x01,0x03,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x01,0x01,0x03,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C:\Users\zjyhuoer\Desktop\5.bmp",0*/

};

unsigned char BMP4[] ={//右转脸
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xC0,0x80,0x80,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xC0,0x80,0x80,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
        0xFF,0xFF,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x03,0x01,0x01,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x03,0x01,0x01,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C:\Users\zjyhuoer\Desktop\6.bmp",0*/
        /* (128 X 64 )*/

};

unsigned char BMP5[] ={//特殊脸

        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF0,0xF0,
        0x30,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x80,0xF0,0xF0,0xF0,0x80,0xC0,0x00,0x00,
        0x00,0x00,0x00,0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
        0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0xC0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xC0,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
        0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,0x00,0x00,0x00,
        0x00,0x00,0xC0,0x80,0xF0,0xF0,0xF0,0x80,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,
        0xF0,0xF0,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFF,0xFF,0x0F,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x11,0x3F,0x3F,0x0F,0x3F,0x3F,0x11,0x01,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0F,0x0F,0x1E,0x1E,0x3C,0x3C,
        0x3C,0x3C,0x1E,0x1E,0x0F,0x0F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x01,0x11,0x3F,0x3F,0x0F,0x3F,0x3F,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x0F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xF0,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0xF0,0xFF,0xFF,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x0F,0x0F,
        0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,
        0x0F,0x0F,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C:\Users\zjyhuoer\Desktop\7.bmp",0*/
        /* (128 X 64 )*/

};

unsigned char BMP6[] ={ //睡觉脸
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x3E,0x3E,0x3C,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
        0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
        0x38,0x3C,0x3C,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3C,0x3C,0x3C,
        0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,
        0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3C,0x3E,0x3E,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,/*"C:\Users\zjyhuoer\Desktop\9.bmp",0*/
};

#endif

尾巴:

小机器狗的运动步态我也是参考b站大佬的作品(原视频:【步态详解】人人都可制作的WiFi遥控迷你四足机器人_哔哩哔哩_bilibili

他做得比我好,且也开源>-<


本文转载自: https://blog.csdn.net/Huooer/article/details/134611701
版权归原作者 Huooer 所有, 如有侵权,请联系我们删除。

“开源!自制一个桌面宠物(STM32CUBEMX HAL库 PWM波 小项目)”的评论:

还没有评论