feat: 开启速度闭环
fix: 暂时修复通信卡死问题
This commit is contained in:
95
app/page/page_dparam.c
Normal file
95
app/page/page_dparam.c
Normal file
@@ -0,0 +1,95 @@
|
||||
#include "jj_param.h"
|
||||
#include "page_ui_widget.h"
|
||||
#include "jj_motion.h"
|
||||
#include "page.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define LINE_HEAD 0
|
||||
#define LINE_END DATA_NUM - 2
|
||||
static char Text[] = "dParam";
|
||||
static int8_t Curser = LINE_HEAD; // 定义光标位置
|
||||
static int8_t Curser_Last = LINE_HEAD; // 定义光标位置
|
||||
/***************************************************************************************
|
||||
*
|
||||
* 以下为页面模板函数
|
||||
*
|
||||
***************************************************************************************/
|
||||
/**
|
||||
* @brief 页面初始化事件
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Setup()
|
||||
{
|
||||
ips200_clear();
|
||||
Print_Curser(Curser, Curser_Last, RGB565_PURPLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面退出事件
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Exit()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面循环执行的内容
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
static void Loop()
|
||||
{
|
||||
ips200_show_string(0, 40, "far");
|
||||
ips200_show_float(80, 40, in_angle, 4, 1);
|
||||
ips200_show_string(0, 60, "near");
|
||||
ips200_show_float(80, 60, in_pos, 4, 1);
|
||||
ips200_show_string(0, 80, "gyrz");
|
||||
ips200_show_float(80, 80, in_gyro, 4, 2);
|
||||
ips200_show_string(0, 100, "speed");
|
||||
ips200_show_float(80, 100, in_speed, 4, 4);
|
||||
ips200_show_string(0, 120, "outang");
|
||||
ips200_show_float(80, 120, out_angle, 4, 1);
|
||||
ips200_show_string(0, 140, "outgyr");
|
||||
ips200_show_float(80, 140, out_gyro, 4, 1);
|
||||
ips200_show_string(0, 160, "outpos");
|
||||
ips200_show_float(80, 160, out_pos, 4, 1);
|
||||
}
|
||||
/**
|
||||
* @brief 页面事件
|
||||
* @param btn:发出事件的按键
|
||||
* @param event:事件编号
|
||||
* @retval 无
|
||||
*/
|
||||
static void Event(page_event event)
|
||||
{
|
||||
|
||||
Curser_Last = Curser;
|
||||
if (page_event_forward == event) {
|
||||
Curser--; // 光标上移
|
||||
} else if (page_event_backward == event) {
|
||||
Curser++; // 光标下移
|
||||
} else if (page_event_press_short == event) {
|
||||
sport_pid_init();
|
||||
} else if (page_event_press_long == event) {
|
||||
Page_Shift(page_menu);
|
||||
}
|
||||
if (Curser < LINE_HEAD) {
|
||||
Curser = LINE_END;
|
||||
} else if (Curser > LINE_END) {
|
||||
Curser = LINE_HEAD;
|
||||
}
|
||||
Print_Curser(Curser, Curser_Last, RGB565_PURPLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 页面注册函数
|
||||
*
|
||||
* @param pageID
|
||||
*/
|
||||
void PageRegister_page_dparam(unsigned char pageID)
|
||||
{
|
||||
Page_Register(pageID, Text, Setup, Loop, Exit, Event);
|
||||
}
|
||||
Reference in New Issue
Block a user