u8g2图形库——丝滑菜单制作

目录

一、实物效果展示

二、丝滑菜单实现原理

三、代码开源

1.ui_bmp.h

2.ui.h

3.ui.c


一、实物效果展示

u8g2图形库——丝滑菜单制作

二、丝滑菜单实现原理

int ui_run(short *a,short *a_tag,uint8_t step,uint8_t slow_cnt)             //UI滑动效果
{uint8_t temp;temp = abs(*a_tag - *a) > slow_cnt ? step : 1;if(*a < *a_tag){*a += temp;}else if (*a > *a_tag){*a -= temp;}else{return 0;}return 1;
}

三、代码开源

1.ui_bmp.h

#ifndef _UI_BMP_H
#define _UI_BMP_H#include "main.h"
#include "u8g2.h"const uint8_t wifi[] U8X8_PROGMEM = {
0x00, 0x00, 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, 0x0f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 
0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x80, 0xf8, 0x7f, 0x00, 0xe0, 0xff, 0xc1, 0xfc, 0x1f, 0x00, 0x80, 0xff, 0xe3, 
0xfe, 0x07, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x01, 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x00, 0xff, 0x1f, 0xe0, 0xff, 0x3f, 0xe0, 0xff, 0xff, 0xc0, 0xff, 
0x0f, 0xf8, 0xff, 0xff, 0x81, 0x0f, 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x80, 0xff, 0x03, 0xfc, 0x1f, 0x00, 
0x80, 0x7f, 0x00, 0xe0, 0x1f, 0x00, 0x80, 0x1f, 0x00, 0xc0, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0xfc, 0x07, 0x0c, 0x00, 
0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 
0x00, 0xe0, 0x1f, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 
0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 
0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
};const uint8_t clock[] U8X8_PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x83, 0xff, 0x1f, 0x3c, 0x00, 
0xe0, 0x83, 0xff, 0x1f, 0x7c, 0x00, 0xf0, 0x83, 0xff, 0x1f, 0xfc, 0x80, 0xf8, 0x83, 0xff, 0x1f, 0xfc, 0x81, 0xf8, 0x83, 0xff, 0x1f, 0xfc, 0x81, 
0xf8, 0xff, 0xff, 0xff, 0xff, 0x81, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x81, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x81, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x81, 
0xf8, 0xff, 0xff, 0xff, 0xff, 0x81, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x81, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 
0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 
0x18, 0x7c, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 
0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x7c, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 
0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 
0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x7e, 0xf8, 0xe1, 0x87, 0x81, 0x18, 0x7c, 0xf8, 0xe0, 0x83, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 
0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x70, 0x00, 0x00, 0x00, 0xe0, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x7f, 0x00, 
0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
};const uint8_t seting[] U8X8_PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0xf0, 0x07, 0x7e, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x01, 0x00, 
0x00, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x80, 0x7f, 0xff, 0xe7, 0x1f, 0x00, 0x80, 0x1f, 0xf8, 0x81, 0x1f, 0x00, 
0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 
0xc0, 0x07, 0x00, 0x00, 0x3f, 0x00, 0xc0, 0x07, 0xf0, 0x00, 0x3e, 0x00, 0xe0, 0x07, 0xfc, 0x03, 0x7e, 0x80, 0xf8, 0x03, 0xff, 0x0f, 0xfc, 0xe1, 
0xfe, 0x81, 0xff, 0x1f, 0xf8, 0xe3, 0xfe, 0xc0, 0xff, 0x1f, 0xf8, 0xe7, 0x7e, 0xc0, 0x0f, 0x3f, 0xe0, 0xe7, 0x3e, 0xc0, 0x07, 0x3e, 0xc0, 0xe7, 
0x1e, 0xe0, 0x03, 0x7c, 0xc0, 0xe7, 0x1e, 0xe0, 0x03, 0x7c, 0xc0, 0xe7, 0x1e, 0xe0, 0x03, 0x7c, 0xc0, 0xe7, 0x1e, 0xe0, 0x03, 0x7c, 0xc0, 0xe7, 
0x3e, 0xc0, 0x07, 0x3e, 0xc0, 0xe7, 0x7e, 0xc0, 0x8f, 0x3f, 0xe0, 0xe7, 0xfe, 0x80, 0xff, 0x1f, 0xf8, 0xe7, 0xfe, 0x81, 0xff, 0x0f, 0xf8, 0x83, 
0xf8, 0x03, 0xff, 0x07, 0xfc, 0x00, 0xe0, 0x03, 0xfc, 0x03, 0x7e, 0x00, 0xe0, 0x07, 0xf0, 0x00, 0x3e, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x3f, 0x00, 
0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x1f, 0x00, 
0x80, 0x1f, 0xf8, 0x81, 0x1f, 0x00, 0x80, 0x7f, 0xff, 0xe7, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x03, 0x00, 
0x00, 0xf8, 0xff, 0xff, 0x01, 0x00, 0x00, 0xe0, 0x07, 0x7e, 0x00, 0x00, 0x00, 0x80, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
};const uint8_t tianqi[] U8X8_PROGMEM = {
0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 
0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x80, 0x00, 0x60, 0x00, 0x18, 0x00, 0xc0, 0x03, 0x60, 0x00, 0x3c, 0x00, 
0x80, 0x07, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x0f, 0xf8, 0x01, 0x0f, 0x00, 0x00, 0x0f, 0xff, 0x0f, 0x07, 0x00, 0x00, 0xce, 0xff, 0x1f, 0x03, 0x00, 
0x00, 0xe0, 0xdf, 0x7f, 0x00, 0x00, 0x00, 0xf0, 0x03, 0xfc, 0x00, 0x00, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x78, 0x00, 0xe0, 0x01, 0x00, 
0x00, 0x3c, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x3c, 0xe0, 0xdf, 0x03, 0x00, 0x00, 0x1c, 0xf8, 0xff, 0x03, 0x00, 0x00, 0x1c, 0xfe, 0xff, 0x03, 0xe0, 
0x7e, 0x1e, 0x3f, 0xf0, 0xe3, 0xf7, 0xff, 0x9e, 0x0f, 0xc0, 0xf7, 0xff, 0xff, 0x9e, 0x07, 0x80, 0xf7, 0x0f, 0x00, 0xff, 0x03, 0x00, 0x0f, 0x00, 
0x80, 0xff, 0x01, 0x00, 0x0e, 0x00, 0xc0, 0xff, 0x01, 0x00, 0x1e, 0x00, 0xc0, 0xc1, 0x00, 0x00, 0x1c, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x1c, 0x00, 
0xe0, 0x01, 0x00, 0x00, 0x7c, 0x80, 0xf8, 0x01, 0x00, 0x00, 0xfc, 0xc1, 0xfc, 0x00, 0x00, 0x00, 0xf8, 0xe3, 0x3e, 0x00, 0x00, 0x00, 0xc0, 0xe7, 
0x1e, 0x00, 0x00, 0x00, 0x80, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x7e, 
0x07, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x1e, 0x00, 0x00, 0x00, 0x80, 0xe7, 
0x3e, 0x00, 0x00, 0x00, 0xc0, 0xc3, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x7f, 0x00, 
};const uint8_t shi[] U8X8_PROGMEM = {
0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x7f, 0x00, 0x00, 
0x00, 0xfc, 0x01, 0xf8, 0x01, 0x00, 0x80, 0x3f, 0x00, 0xc0, 0x0f, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0x7f, 0x80, 0xf8, 0x01, 0x00, 0x00, 0xf8, 0xf1, 
0x7f, 0x00, 0x00, 0x00, 0xe0, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x80, 
0x18, 0xe6, 0x00, 0x00, 0x80, 0x81, 0x18, 0xe6, 0x00, 0x00, 0x80, 0x81, 0x18, 0x7e, 0xf8, 0x03, 0x80, 0x81, 0x18, 0x7c, 0xfe, 0x07, 0x80, 0x81, 
0x18, 0x18, 0x0f, 0x0e, 0x80, 0x81, 0x18, 0x80, 0x07, 0x0c, 0x80, 0x81, 0x18, 0x80, 0x03, 0x00, 0x80, 0x81, 0x18, 0x80, 0x01, 0x00, 0x80, 0x81, 
0x18, 0xc0, 0x01, 0x00, 0x80, 0x81, 0x18, 0xc0, 0x00, 0x00, 0x80, 0x81, 0x18, 0xc0, 0x00, 0x00, 0x80, 0x81, 0x18, 0xc0, 0x01, 0x00, 0x80, 0x81, 
0x18, 0xc0, 0x01, 0x00, 0x80, 0x81, 0x18, 0x80, 0x01, 0x00, 0x80, 0x81, 0x18, 0x80, 0x03, 0x00, 0x80, 0x81, 0x18, 0x00, 0x07, 0x1c, 0x80, 0x81, 
0x18, 0x00, 0x0f, 0x0e, 0x80, 0x81, 0x18, 0x00, 0xfc, 0x0f, 0x80, 0x81, 0x18, 0x00, 0xf8, 0x03, 0x80, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 
0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 
0x18, 0x00, 0x00, 0x00, 0x80, 0x81, 0xb8, 0xff, 0xff, 0xff, 0xff, 0x01, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x7f, 0x00, 
};const uint8_t led[] U8X8_PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 
0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x60, 0x00, 0x01, 0x00, 
0x00, 0x1e, 0x00, 0x80, 0x03, 0x00, 0x00, 0x3c, 0x00, 0xc0, 0x03, 0x00, 0x00, 0x78, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x30, 0xf0, 0xc1, 0x00, 0x00, 
0x00, 0x10, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x80, 0x0f, 0x1e, 0x00, 0x00, 
0x00, 0xc0, 0x03, 0x3c, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0xc0, 0xc3, 0x01, 0x38, 0x7c, 0x00, 0xe0, 0xc7, 0x01, 0x38, 0x7c, 0x00, 
0xe0, 0xc7, 0x01, 0x38, 0x7c, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 
0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 
0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x38, 0x00, 0x00, 
0x00, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x00, 
0x00, 0x00, 0x07, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0e, 0x00, 0x00, 
0x00, 0x00, 0x07, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
};const uint8_t beep[] U8X8_PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 
0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 
0x00, 0x80, 0xdf, 0x01, 0x30, 0x00, 0x00, 0xc0, 0xc7, 0x01, 0x70, 0x00, 0x00, 0xe0, 0xc3, 0x01, 0xf0, 0x00, 0x00, 0xf8, 0xc0, 0x01, 0xe0, 0x01, 
0x00, 0x7c, 0xc0, 0x01, 0xc0, 0xf1, 0xff, 0x3f, 0xc0, 0x01, 0xc0, 0xf3, 0xff, 0x0f, 0xc0, 0x01, 0x80, 0xf3, 0xff, 0x07, 0xc0, 0x01, 0x00, 0x77, 
0x07, 0x00, 0xc0, 0x81, 0x00, 0x77, 0x07, 0x00, 0xc0, 0xc1, 0x01, 0x77, 0x07, 0x00, 0xc0, 0xc1, 0x03, 0x7f, 0x07, 0x00, 0xc0, 0x81, 0x03, 0x7e, 
0x07, 0x00, 0xc0, 0x81, 0x03, 0x7e, 0x07, 0x00, 0xc0, 0x81, 0x03, 0x7e, 0x07, 0x00, 0xc0, 0x01, 0x03, 0x7e, 0x07, 0x00, 0xc0, 0x81, 0x03, 0x7e, 
0x07, 0x00, 0xc0, 0x81, 0x03, 0x7e, 0x07, 0x00, 0xc0, 0xc1, 0x03, 0x7e, 0x07, 0x00, 0xc0, 0xc1, 0x01, 0x77, 0x07, 0x00, 0xc0, 0xc1, 0x01, 0xf7, 
0xff, 0x07, 0xc0, 0x01, 0x00, 0xf7, 0xff, 0x0f, 0xc0, 0x01, 0x80, 0xf3, 0xff, 0x1f, 0xc0, 0x01, 0xc0, 0x03, 0x00, 0x7e, 0xc0, 0x01, 0xc0, 0x01, 
0x00, 0xf8, 0xc0, 0x01, 0xe0, 0x01, 0x00, 0xe0, 0xc3, 0x01, 0xf0, 0x00, 0x00, 0xc0, 0xc7, 0x01, 0x70, 0x00, 0x00, 0x80, 0xdf, 0x01, 0x30, 0x00, 
0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
};#endif 

2.ui.h

#ifndef _UI_H
#define _UI_H#include "main.h"
#include "oled.h"
#include "u8g2.h"
#include <stdio.h>
#include "key.h"
#include <math.h>
#include <stdlib.h>
#include "beep.h"
// #include "ui_bmp.h"extern short time_x,time_x_tag;
extern short tianqi_x,tianqi_x_tag;
extern short shi_x,shi_x_tag;
extern short led_x,led_x_tag;
extern short beep_x,beep_x_tag;
extern short wangluo_x,wangluo_x_tag; 
extern short time_y,time_y_tag;
extern short tianqi_y,tianqi_y_tag;
extern short shi_y,shi_y_tag;
extern short led_y,led_y_tag;
extern short beep_y,beep_y_tag;
extern short wangluo_y,wangluo_y_tag;extern short wifi_frame_len,wifi_frame_len_tag;
extern short wifi_y_offset,wifi_y_offset_tag; 
extern short led_frame_len,led_frame_len_tag;
extern short led_y_offset,led_y_offset_tag; 
extern short beep_frame_len,beep_frame_len_tag;  
extern short beep_y_offset,beep_y_offset_tag;  extern int ui_select;
extern int ui_wifi_select;
extern int wifi_select;
extern int ui_led_select;                          
extern int led_select;  
extern int ui_beep_select;       
extern int beep_select;                 
extern int state;
extern u8g2_t u8g2;  extern short red_led,green_led,blue_led;typedef struct
{char* str;int len;
}SETTING_LIST;extern SETTING_LIST list_led[];
extern SETTING_LIST list_beep[];
extern SETTING_LIST list_wang[];
extern SETTING_LIST list_tianqi[];void ui_progress(int tag_y,int time);
int ui_run(short *a,short *a_tag,uint8_t step,uint8_t slow_cnt);
void ui_menu(void);
void key_proc(void);
void drawDial(float value,int x,int y);
void drawStyledHalfDial(float value,int centerX,int centerY);
void task_select(void);
void wifi_ui(void);
void time_ui(int x,int y,int year,int month,int day,int hour,int minute,int second);
void tianqi_ui(void);
void shiwen_ui(void);
void led_ui(void);
void beep_ui(void);#endif // !_UI_H

3.ui.c

#include "ui.h"
#include "ui_bmp.h"short menu_x,menu_x_tag,menu_y,menu_y_tag;          //菜单界面的x,y与菜单目标x,yshort beep_x,beep_x_tag;      //beep x:当前位置数值,x_tag:目标值
short led_x,led_x_tag;        //led x:当前位置数值,x_tag:目标值
short shi_x,shi_x_tag;        //shi x:当前位置数值,x_tag:目标值
short tianqi_x,tianqi_x_tag;        //tianqi x:当前位置数值,x_tag:目标值
short time_x,time_x_tag;        //time x:当前位置数值,x_tag:目标值
short wangluo_x,wangluo_x_tag;      //网络x:当前位置数值,x_tag:目标值short beep_y=80,beep_y_tag=80;
short led_y=80,led_y_tag=80;
short shi_y=80,shi_y_tag=80;
short tianqi_y=80,tianqi_y_tag=80;
short time_y=80,time_y_tag=80;
short wangluo_y=80,wangluo_y_tag=80;short wifi_frame_len,wifi_frame_len_tag;      //wifi框的宽度和框的宽度目标值
short wifi_y_offset,wifi_y_offset_tag;          //wifi框的y值与目标值
short led_frame_len,led_frame_len_tag;      //led框的宽度和框的宽度目标值
short led_y_offset,led_y_offset_tag;          //led框的y值与目标值
short beep_frame_len,beep_frame_len_tag;      //beep框的宽度和框的宽度目标值
short beep_y_offset,beep_y_offset_tag;          //beep框的y值与目标值int ui_select = 0;                     //列表的选定int ui_wifi_select = 0;                //wifi列表的选择状态
int wifi_select = 0;                   //wifi列表的选项
int ui_led_select = 0;                  //led列表的选择状态        
int led_select = 0;                     //led列表的选项
int ui_beep_select = 0;                  //beep列表的选择状态        
int beep_select = 0;                     //beep列表的选项int state;          //状态机int beep_list_len,wangluo_list_len,led_list_len,tianqi_list_len;u8g2_t u8g2;        //显示器初始化结构体//蜂鸣器菜单
SETTING_LIST list_beep[] =
{{"ON",2},{"OFF",3},
};
//led菜单
SETTING_LIST list_led[] =
{{"R",1},{"G",1},{"B",1},
};
//天气菜单
SETTING_LIST list_tianqi[] =
{{"today",5},{"next",4},{"after",5},
};
//网络菜单
SETTING_LIST list_wang[] =
{{"ON",2},{"OFF",3},{"RESET",5},
};void ui_progress(int tag_y,int time)                //进度条
{u8g2_FirstPage(&u8g2);                                            do{for(uint8_t i=0;i<=99;i=i+2){if(i==76)   HAL_Delay(500);u8g2_ClearBuffer(&u8g2); char buff[20];//u8g2_SetFont(&u8g2,u8g2_font_ncenB08_tf);//字体sprintf(buff,"%d%%",(int)(i/100.0*100));u8g2_DrawStr(&u8g2,105,tag_y+9,buff);//当前进度显示u8g2_DrawRBox(&u8g2,2,tag_y,i,10,5);//填充框实心矩形框u8g2_DrawRFrame(&u8g2,0,tag_y-2,103,14,5);//空心矩形框HAL_Delay(time);u8g2_SendBuffer(&u8g2);}}while (u8g2_NextPage(&u8g2));
}int ui_run(short *a,short *a_tag,uint8_t step,uint8_t slow_cnt)             //UI滑动效果
{uint8_t temp;temp = abs(*a_tag - *a) > slow_cnt ? step : 1;if(*a < *a_tag){*a += temp;}else if (*a > *a_tag){*a -= temp;}else{return 0;}return 1;
}void ui_menu(void)
{u8g2_ClearBuffer(&u8g2);task_select();wifi_ui();time_ui(time_x-70,time_y-18,2023,11,23,15,47,56);tianqi_ui();shiwen_ui();led_ui();beep_ui();ui_run(&menu_x,&menu_x_tag,10,8);ui_run(&menu_y,&menu_y_tag,10,8);ui_run(&time_y,&time_y_tag,10,8);ui_run(&time_x,&time_x_tag,10,8);ui_run(&tianqi_y,&tianqi_y_tag,10,8);ui_run(&tianqi_x,&tianqi_x_tag,10,8);ui_run(&shi_y,&shi_y_tag,10,8);ui_run(&shi_x,&shi_x_tag,10,8);ui_run(&led_y,&led_y_tag,10,8);ui_run(&led_x,&led_x_tag,10,8);ui_run(&beep_y,&beep_y_tag,10,8);ui_run(&beep_x,&beep_x_tag,10,8);ui_run(&wangluo_y,&wangluo_y_tag,10,8);ui_run(&wangluo_x,&wangluo_x_tag,10,8);ui_run(&wifi_y_offset,&wifi_y_offset_tag,3,4);ui_run(&wifi_frame_len,&wifi_frame_len_tag,4,4);ui_run(&led_y_offset,&led_y_offset_tag,3,4);ui_run(&led_frame_len,&led_frame_len_tag,4,4);ui_run(&beep_y_offset,&beep_y_offset_tag,3,4);ui_run(&beep_frame_len,&beep_frame_len_tag,4,4);HAL_Delay(10);u8g2_SendBuffer(&u8g2);
}void key_proc(void)                         
{menu_x_tag = beep_x = led_x = shi_x = tianqi_x = time_x = wangluo_x = ui_select*70;if(ui_wifi_select == 0 && ui_led_select == 0 && ui_beep_select == 0){if(key[3].single_flag == 1)         //右移动{key[3].single_flag = 0;ui_select--;beep_didi(20);if(ui_select <= 0){ui_select = 0;}}if(key[2].single_flag == 1)             //左移动{key[2].single_flag = 0;ui_select++;beep_didi(20);if(ui_select >= 5){ui_select = 5;}}}if(key[0].long_flag == 1)             //往上移动{key[0].long_flag = 0;ui_wifi_select = 0;ui_led_select = 0;ui_beep_select = 0;beep_didi(20);menu_y_tag = 0;if(ui_select ==5)   beep_y_tag = 80;if(ui_select ==4)   led_y_tag = 80;if(ui_select ==3)   shi_y_tag = 80;if(ui_select ==2)   tianqi_y_tag = 80;if(ui_select ==1)   time_y_tag = 80;if(ui_select ==0)   wangluo_y_tag = 80;}if(key[1].long_flag == 1)             //往下移动{key[1].long_flag = 0;beep_didi(20);menu_y_tag = -64;if(ui_select ==5){beep_y_tag = 20;ui_beep_select = 1;}   if(ui_select ==4){led_y_tag = 20;ui_led_select = 1;}   if(ui_select ==3)   shi_y_tag = 20;if(ui_select ==2)   tianqi_y_tag = 20;if(ui_select ==1)   time_y_tag = 20;if(ui_select ==0){wangluo_y_tag = 20;ui_wifi_select = 1;}        }if(ui_beep_select == 1 && ui_select == 5)           //beep二级菜单选择{if(key[0].single_flag == 1)                     //上移动{key[0].single_flag = 0;beep_didi(20);beep_y_offset_tag -= 20;beep_select -= 1;}if(key[1].single_flag == 1)                     //下移动{key[1].single_flag = 0;beep_didi(20);beep_y_offset_tag += 20;beep_select += 1;}}if(ui_led_select == 1 && ui_select == 4)           //led二级菜单选择{if(key[0].single_flag == 1)                     //上移动{key[0].single_flag = 0;beep_didi(20);led_y_offset_tag -= 20;led_select -= 1;}if(key[1].single_flag == 1)                     //下移动{key[1].single_flag = 0;beep_didi(20);led_y_offset_tag += 20;led_select += 1;}if(led_select == 1)                             //绿灯值{if(key[3].single_flag == 1)                 //右加    {key[3].single_flag = 0;beep_didi(20);green_led += 1;}if(key[2].single_flag == 1)                 //右减 {key[2].single_flag = 0;beep_didi(20);green_led -= 1;}}if(led_select == 0)                             //红灯值{if(key[3].single_flag == 1)                 //右加    {key[3].single_flag = 0;beep_didi(20);red_led += 1;}if(key[2].single_flag == 1)                 //右减 {key[2].single_flag = 0;beep_didi(20);red_led -= 1;}}if(led_select == 2)                             //蓝灯值{if(key[3].single_flag == 1)                 //右加    {key[3].single_flag = 0;beep_didi(20);blue_led += 1;}if(key[2].single_flag == 1)                 //右减 {key[2].single_flag = 0;beep_didi(20);blue_led -= 1;}}}if(ui_wifi_select == 1 && ui_select == 0)           //wifi二级菜单选择{if(key[0].single_flag == 1)                     //上移动{key[0].single_flag = 0;beep_didi(20);wifi_y_offset_tag -= 20;wifi_select -= 1;}if(key[1].single_flag == 1)                     //下移动{key[1].single_flag = 0;beep_didi(20);wifi_y_offset_tag += 20;wifi_select += 1;}}wifi_frame_len_tag = list_wang[wifi_select].len*13;led_frame_len_tag = list_led[led_select].len*13;beep_frame_len_tag = list_beep[beep_select].len*13;ui_menu();
}void task_select(void)                      //任务选择菜单显示
{u8g2_DrawXBMP(&u8g2,menu_x+40,menu_y+10,44,44,wifi);u8g2_DrawXBMP(&u8g2,menu_x-30,menu_y+10,44,44,clock);u8g2_DrawXBMP(&u8g2,menu_x-100,menu_y+10,44,44,tianqi);u8g2_DrawXBMP(&u8g2,menu_x-170,menu_y+10,44,44,shi);u8g2_DrawXBMP(&u8g2,menu_x-240,menu_y+10,44,44,led);u8g2_DrawXBMP(&u8g2,menu_x-310,menu_y+10,44,44,beep);
}void wifi_ui(void)                      //wifi任务功能
{wangluo_list_len = sizeof(list_wang) / sizeof(SETTING_LIST);for(int i = 0;i < wangluo_list_len;i++){u8g2_DrawStr(&u8g2,wangluo_x+2,wangluo_y+i*20,list_wang[i].str);}u8g2_SetDrawColor(&u8g2,2);u8g2_DrawRBox(&u8g2,wangluo_x,wangluo_y-16+wifi_y_offset,wifi_frame_len,22,3);u8g2_SetDrawColor(&u8g2,1);
}char str_time[20];void time_ui(int x,int y,int year,int month,int day,int hour,int minute,int second)                      //time任务功能
{u8g2_DrawRFrame(&u8g2,x+5,y+3,122,58,10);sprintf(str_time,"%d-%d-%d",year,month,day);u8g2_SetFont(&u8g2,u8g2_font_t0_16_mf);u8g2_DrawStr(&u8g2,x+25,y+20,str_time);sprintf(str_time,"%d:%d:%d",hour,minute,second);u8g2_SetFont(&u8g2,u8g2_font_t0_14_mf);u8g2_DrawStrX2(&u8g2,x+10,y+55,str_time);u8g2_SetFont(&u8g2,u8g2_font_t0_22_mf);
}void tianqi_ui(void)                    //天气任务功能
{tianqi_list_len = sizeof(list_tianqi) / sizeof(SETTING_LIST);for(int i = 0;i < tianqi_list_len;i++){u8g2_DrawStr(&u8g2,tianqi_x-146+6,tianqi_y+i*20,list_tianqi[i].str);}
}void shiwen_ui(void)                    //室温任务功能
{drawStyledHalfDial(45.0,shi_x-210+68,shi_y+40);
}char str_led[20];
short red_led,green_led,blue_led;
void led_ui(void)                    //led任务功能
{led_list_len = sizeof(list_led) / sizeof(SETTING_LIST);for(int i = 0;i < led_list_len;i++){u8g2_DrawStr(&u8g2,led_x-274+2,led_y+i*20,list_led[i].str);}sprintf(str_led,"%d",red_led);u8g2_DrawStr(&u8g2,led_x-274+2+98,led_y,str_led);          //当前进度显示              红u8g2_DrawRFrame(&u8g2,23,led_y-14,80,14,5);             //空心矩形框u8g2_DrawRBox(&u8g2,23,led_y-12,red_led,10,5);              //填充框实心矩形框sprintf(str_led,"%d",green_led);u8g2_DrawStr(&u8g2,led_x-274+2+98,led_y+20,str_led);          //当前进度显示              绿u8g2_DrawRFrame(&u8g2,23,led_y+20-14,80,14,5);             //空心矩形框u8g2_DrawRBox(&u8g2,23,led_y+20-12,green_led,10,5);              //填充框实心矩形框sprintf(str_led,"%d",blue_led);u8g2_DrawStr(&u8g2,led_x-274+2+98,led_y+40,str_led);          //当前进度显示              蓝u8g2_DrawRFrame(&u8g2,23,led_y+40-14,80,14,5);             //空心矩形框u8g2_DrawRBox(&u8g2,23,led_y+40-12,blue_led,10,5);              //填充框实心矩形框u8g2_SetDrawColor(&u8g2,2);u8g2_DrawRBox(&u8g2,led_x-274+2,led_y-16+led_y_offset,led_frame_len,22,3);u8g2_SetDrawColor(&u8g2,1);
}void beep_ui(void)                    //beep任务功能
{beep_list_len = sizeof(list_beep) / sizeof(SETTING_LIST);for(int i = 0;i < beep_list_len;i++){u8g2_DrawStr(&u8g2,beep_x-338+2,beep_y+i*20,list_beep[i].str);}u8g2_SetDrawColor(&u8g2,2);u8g2_DrawRBox(&u8g2,beep_x-338+2,beep_y-16+beep_y_offset,beep_frame_len,22,3);u8g2_SetDrawColor(&u8g2,1);
}void drawDial(float value,int x,int y) {// 仪表盘半径int radius = u8g2.height / 2.1;  // 半径// 仪表盘背景u8g2_SetFont(&u8g2, u8g2_font_ncenB14_tr);u8g2_DrawStr(&u8g2, 5, 20, "M");// 绘制仪表盘外框u8g2_DrawCircle(&u8g2, x, y, radius, U8G2_DRAW_ALL);// 绘制刻度for (int angle = 0; angle < 360; angle += 15) {float radian = angle * 3.14 / 180.0;int startX = x + (radius - 5) * cos(radian);int startY = y - (radius - 5) * sin(radian);int endX = x + radius * cos(radian);int endY = y - radius * sin(radian);u8g2_DrawLine(&u8g2, startX, startY, endX, endY);}// 计算指针的终点坐标float angle = value * 3.14 / 180.0;int endX = x + radius * cos(angle);int endY = y - radius * sin(angle);// 绘制指针u8g2_DrawLine(&u8g2, x, y, endX, endY);
}char str_shi[20];void drawStyledHalfDial(float value,int centerX,int centerY)        //64 57
{// 仪表盘半径int radius = u8g2.height / 1.2;// 清除屏幕// u8g2_ClearBuffer(&u8g2);//shusprintf(str_shi,"%.1f",value);u8g2_DrawStr(&u8g2,centerX-20,centerY-13,str_shi);// 绘制刻度for (int angle = 0; angle <= 180; angle += 15) {float radian = angle * 3 / 180.0;int startX = centerX + (radius - 5) * cos(radian);int startY = centerY - (radius - 5) * sin(radian);int endX = centerX + radius * cos(radian);int endY = centerY - radius * sin(radian);u8g2_DrawLine(&u8g2, startX, startY, endX, endY);u8g2_DrawLine(&u8g2, startX - 1, startY - 1, endX - 1, endY - 1);}// 计算指针的终点坐标float angle = value * 3 / 180.0;int endX = centerX + radius * cos(angle);int endY = centerY - radius * sin(angle);// 绘制指针u8g2_DrawLine(&u8g2, centerX, centerY, endX, endY);// 更新显示// u8g2_SendBuffer(&u8g2);
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/182612.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

试写一算法将两个递增有序的带头结点的单链表合并为一个递增有序的带头结点的单链表。(利用原表结点空间)

试写一算法将两个递增有序的带头结点的单链表合并为一个递增有序的带头结点的单链表。 &#xff08;利用原表结点空间&#xff09; 比如现在要将下面两个链表合并&#xff0c;这里是要求利用原表空间 我们先创建一个辅助的链表L3&#xff0c;用p和q分别标记L1和L2的数据元素&…

L298N模块使用简介

接口作用ENA/ENB使用PWM调节马达转速&#xff08;调速&#xff09;左边一对接口接电机的正负极右边一对接口接电机正负极控制IN1,IN2 控制左边的2个接口的电压&#xff0c;IN1控制一个&#xff0c;IN2控制另外一个 IN1输入3.3V时&#xff0c;OUT1输出3.3v电压&#xff08;可能是…

NoSQL大数据存储技术思考题及参考答案

思考题及参考答案 第1章 绪论 1. NoSQL和关系型数据库在设计目标上有何主要区别&#xff1f; (1)关系数据库 优势&#xff1a;以完善的关系代数理论作为基础&#xff0c;具有数据模型、完整性约束和事务的强一致性等特点&#xff0c;借助索引机制可以实现高效的查询&#xf…

创建Asp.net MVC项目Ajax实现视图页面数据与后端Json传值显示

简述回顾 继上篇文章创建的mvc传值这里说明一下Json传值。在mvc框架中&#xff0c;不可避免地会遇到前台传值到后台&#xff0c;前台接收后台的值的情况&#xff08;前台指view&#xff0c;后台指controller&#xff09;&#xff0c;有时只需要从控制器中返回一个处理的结果&a…

execl点击单元格跳转

通过点击单元格跳转到其它单元格并获取单元格文本对数据进行过滤 平时我们通过超链接可以实现单元格跳转&#xff0c;但是并不能对数据进行过滤 此时我们可以用execl的宏来实现 实现的效果如图: 完整代码下载链接

【上海大学数字逻辑实验报告】二、组合电路(一)

一、 实验目的 熟悉TTL异或门构成逻辑电路的基本方式&#xff1b;熟悉组合电路的分析方法&#xff0c;测试组合逻辑电路的功能&#xff1b;掌握构造半加器和全加器的逻辑测试&#xff1b;学习使用可编程逻辑器件的开发工具 Quartus II设计电路。 二、 实验原理 异或门是数字…

SpringBoot+VUE3前后端分离-【支付宝支付】

1、支付宝沙箱应用申请 https://open.alipay.com/develop/sandbox/app 打开支付宝沙箱能够看到如下信息&#xff1a; 获取到appid&#xff1b; 2、获取应用私钥以及支付宝公钥 在接口加密方式选择公钥模式启用&#xff0c;根据操作即可获取应用公钥、应用私钥以及支付宝公钥…

服务运营 |精选:床位知多少?医院调度的几种建模方法(下)

编者按&#xff1a; 住院流程&#xff08;Inpatient Flow&#xff09;是一种通过协调和优化医院内部流程&#xff0c;以提高患者入院至出院期间的效率和质量的方法。住院流程通常通过医院内部信息系统和协同工作流程进行管理&#xff0c;以确保患者得到及时的诊断、治疗和护理…

Vue组件开发:工具提示组件的实现方法

在Web开发当中&#xff0c;工具提示&#xff08;Tooltip&#xff09;是一种常用的用户界面组件&#xff0c;用于向用户提供额外的信息或说明。它通常以文本形式显示在鼠标悬停或点击某个元素时&#xff0c;为用户提供更详细的内容展示。在本文中&#xff0c;我们将探讨如何使用…

异常数据检测 | Python实现基于高斯概率分布的异常检测

异常数据检测 | Python实现基于高斯概率分布的异常检测 高斯分布也称为正态分布。它可以被用来进行异常值检测,不过我们首先要假设我们的数据是正态分布的。不过这个假设不能适应于所有数据集。但如果我们做了这种假设那么它将会有一种有效的方法来发现异常值。 Scikit-Learn的…

AI PC专题:AI PC深入变革PC产业

今天分享的是AI系列深度研究报告&#xff1a;《AI PC专题&#xff1a;AI PC深入变革PC产业》。 &#xff08;报告出品方&#xff1a;西南证券研究发展中心&#xff09; 报告共计&#xff1a;30页 AI PC将深入变革PC产业  从出货量看&#xff0c;PC整体呈现周期性的特征。2…

微信小程序+中草药分类+爬虫+torch

1 介绍 本项目提供中草药数据集&#xff0c;使用gpu、cpu版本的torch版本进行训练&#xff0c;将模型部署到后端flask&#xff0c;最后使用微信小程序进行展示出来。 数据爬虫可以参考&#xff1a;http://t.csdnimg.cn/7Olus 项目中的爬虫代码&#xff0c;并且本项目提供相同的…

using meta-SQL 使用元SQL (3)

%FirstRows Syntax %FirstRows(n) Description The %FirstRows meta-SQL variable is replaced by database-specific SQL syntax to optimize retrieval of n rows. Depending on the database, this variable optimizes: FirstRows meta-SQL变量被特定于数据库的SQL语法…

反弹shell命令速查

反弹Shell-Linux 【监听端】centos: 192.168.35.152 【被控端】kali: 192.168.35.128# 监听端执行 [root@localhost ~]# nc -vvl 7777 Ncat: Version 7.50 ( https://nmap.org/ncat ) Ncat: Listening on :::7777 Ncat: Listening on 0.0.0.0:7777bash ┌──(root@kali)-[/h…

基于YOLOv5的人群计数系统设计系统

欢迎大家点赞、收藏、关注、评论啦 &#xff0c;由于篇幅有限&#xff0c;只展示了部分核心代码。 文章目录 一项目简介系统概述系统功能核心技术系统架构系统优势 二、功能三、系统四. 总结  总结 一项目简介 基于YOLOv5的人群计数系统设计是一个非常有趣且具有挑战性的项目…

离散时间信号的分析(数字信号处理实验1-2)

前言&#xff1a;该系列实验均使用matlab完成&#xff0c;实验课程为《数字信号处理》 文章目录 一.题目二.实验目的三.实验仪器四.实验原理实验所用的matlab函数解析离散时间信号实验原理&#xff1a; 五.实验步骤六.实验代码及实验结果完整代码1.线性卷积代码2.循环卷积运算…

(亲测有效)解决windows11无法使用1500000波特率的问题

大家好&#xff01;我是编码小哥&#xff0c;欢迎关注&#xff0c;持续分享更多实用的编程经验和开发技巧&#xff0c;共同进步。 1、问题描述 从图1可以看出串口是正常的&#xff0c;安装的驱动是CP210xVCPInstaller_x64.exe&#xff0c;但是从图2可以看出&#xff0c;串口拒…

HarmonyOS ArkTS 使用DevEco Studio高效开发(十三)

1、快速开始 打开IDE后&#xff0c;在IDE上边栏有个Help入口&#xff0c;里面有一个Quick Start快速开始入口&#xff0c;点击进去就会进入到快速开始面板。在这个面板中会有一些快速入门的实验指导和一些常用的链接。快速开始相当于一个收藏夹&#xff0c;把最常用的一些学习…

苍穹外卖--添加购物车

购物车数据是关联用户的&#xff0c;在表结构中&#xff0c;我们需要记录&#xff0c;每一个用户的购物车数据是哪些菜品列表展示出来的既有套餐&#xff0c;又有菜品&#xff0c;如果用户选择的是套餐&#xff0c;就保存套餐ID(setmeal_id)&#xff0c;如果用户选择的是菜品&a…

git stash save untracked not staged

git stash save untracked not staged 如图 解决方案&#xff1a; git stash save "tag标记信息" --include-untracked或者&#xff1a; git stash save -u "tag标记信息" git stash clear清空本地暂存代码_zhangphil的博客-CSDN博客文章浏览阅读486次。…