-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path修改tft(最终调参4.5).c
93 lines (84 loc) · 3.01 KB
/
修改tft(最终调参4.5).c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
void Display_Initial_Menu()
{
tft180_show_string ( 0, 16*0, "1.Grayscale Image");
tft180_show_string ( 0, 16*1, "2.Turn.P");
tft180_show_string ( 0, 16*2, "3.Turn.I");
tft180_show_string ( 0, 16*3, "4.Turn.D");
tft180_show_string ( 0, 16*4, "5.Speed.P");
// tft180_show_string ( 0, 16*5, "6.Speed.I");
//没位置显示I了,但还在的
//这个乱码什么玩意,只能晚点总结的时候一点点粘了
tft180_show_string ( 0, 16*5, "7.Speed.D");
tft180_show_int (0, 16*6, encoder_data_quaddec,4);
//���� ��ʾ���ֺ���ʾ�ַ�����ʲô��������������ܲ�֧��ֱ����ʾ��ASCII�ַ������纺�ֵ�
}
void Adjust_TurnI(void) {
if (KEY_SHORT_PRESS == key_get_state(KEY_1)) {
Turn.I += 0.1;
}
else if (KEY_SHORT_PRESS == key_get_state(KEY_2)) {
Turn.I -= 0.1;
if (Turn.I < 0) Turn.I = 0;
}
tft180_show_string ( 0, 16*0, "5.Turn_I");
tft180_show_float(0, 16*2, Turn.I, 1, 6);
}
void Display_Second_Menu(uint8_t *List_Number_p){
if(*List_Number_p ==1)
{
//��ʵ�ֵĹ���
Display_Grayscale_Image();
// ����ⲿ�жϴ�����־λ
}
else if(*List_Number_p==2)
{
//��ʵ�ֵĹ���
Adjust_TurnP();
// ����ⲿ�жϴ�����־λ
exti_state[3] = 0;
}
else if(*List_Number_p==3)
{
//��ʵ�ֵĹ���
Adjust_TurnI();
// ����ⲿ�жϴ�����־λ
exti_state[3] = 0;
}
else if(*List_Number_p==4)
{
//��ʵ�ֵĹ���
Adjust_TurnD();
// ����ⲿ�жϴ�����־λ
exti_state[3] = 0;
}
else if(*List_Number_p==5)
{
//��ʵ�ֵĹ���
Adjust_SpeedP();
// ����ⲿ�жϴ�����־λ
exti_state[3] = 0;
}
else if(*List_Number_p==6)
{
//��ʵ�ֵĹ���
Adjust_SpeedI();
// ����ⲿ�жϴ�����־λ
exti_state[3] = 0;
}
else if(*List_Number_p==7)
{
//��ʵ�ֵĹ���
Adjust_SpeedD();
// ����ⲿ�жϴ�����־λ
exti_state[3] = 0;
}
else if(*List_Number_p==8)
{
//��ʵ�ֵĹ���
Adjust_max_angle();
// ����ⲿ�жϴ�����־λ
exti_state[3] = 0;
}
//��һ��key3�ж�״̬
exti_state[2] = 0;
}