Rev 1731 | Rev 1740 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1731 | Rev 1739 | ||
---|---|---|---|
Line 57... | Line 57... | ||
57 | } |
57 | } |
Line 58... | Line 58... | ||
58 | 58 | ||
59 | void Menu_Battery(uint8_t key) |
59 | void Menu_Battery(uint8_t key) |
60 | { //0123456789ABCDEF |
60 | { //0123456789ABCDEF |
- | 61 | JetiBox_printfxy(0,0,"%2i.%1iV %3i.%1iA", UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
|
61 | JetiBox_printfxy(0,0,"%2i.%1iV %3i.%1iA", UBat/10, UBat%10, Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
62 | //1 |
- | 63 | JetiBox_printfxy(0,1,"%4iW %6imAH",Capacity.ActualPower, Capacity.UsedCapacity); |
|
62 | JetiBox_printfxy(0,1,"%4iW %6imAh",Capacity.ActualPower, Capacity.UsedCapacity); |
64 | //1 |
Line 63... | Line 65... | ||
63 | } |
65 | } |
64 | 66 | ||
Line 90... | Line 92... | ||
90 | { //0123456789ABCDEF |
92 | { //0123456789ABCDEF |
91 | JetiBox_printfxy(2,0,"No NaviCtrl!"); |
93 | JetiBox_printfxy(2,0,"No NaviCtrl!"); |
92 | } |
94 | } |
93 | } |
95 | } |
Line -... | Line 96... | ||
- | 96 | ||
- | 97 | //1 |
|
- | 98 | void Menu_Current(uint8_t key) |
|
- | 99 | { //0123456789ABCDEF |
|
- | 100 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].Current-12, Motor[1].Current-12, Motor[2].Current-12, Motor[3].Current-12); |
|
- | 101 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].Current-12, Motor[5].Current-12, Motor[6].Current-12, Motor[7].Current-12); |
|
- | 102 | if(RequiredMotors <= 4) |
|
- | 103 | { |
|
- | 104 | JetiBox_printfxy(0,1,"Currents "); |
|
- | 105 | } |
|
- | 106 | else |
|
- | 107 | if(RequiredMotors <= 6) |
|
- | 108 | { |
|
- | 109 | JetiBox_printfxy(8,1,"%3i.%1iA ",Capacity.ActualCurrent/10, Capacity.ActualCurrent%10); |
|
- | 110 | } |
|
- | 111 | ||
- | 112 | } |
|
- | 113 | //1 |
|
- | 114 | //1 |
|
- | 115 | void Menu_SetPoint(uint8_t key) |
|
- | 116 | { //0123456789ABCDEF |
|
- | 117 | JetiBox_printfxy(0,0,"%3i %3i %3i %3i", Motor[0].SetPoint, Motor[1].SetPoint, Motor[2].SetPoint, Motor[3].SetPoint); |
|
- | 118 | JetiBox_printfxy(0,1,"%3i %3i %3i %3i", Motor[4].SetPoint, Motor[5].SetPoint, Motor[6].SetPoint, Motor[7].SetPoint); |
|
- | 119 | if(RequiredMotors <= 4) |
|
- | 120 | { |
|
- | 121 | JetiBox_printfxy(0,1,"M SetPoint "); |
|
- | 122 | } |
|
- | 123 | else |
|
- | 124 | if(RequiredMotors <= 6) |
|
- | 125 | { |
|
- | 126 | JetiBox_printfxy(8,1,"MSetP "); |
|
- | 127 | } |
|
- | 128 | ||
- | 129 | } |
|
- | 130 | ||
- | 131 | void Menu_Integal(uint8_t key) |
|
- | 132 | { //0123456789ABCDEF |
|
- | 133 | int r=0; |
|
- | 134 | int n=0; |
|
- | 135 | int g=0; |
|
- | 136 | n=SummeNick >> 9; |
|
- | 137 | r=SummeRoll >> 9; |
|
- | 138 | g=Mess_Integral_Gier >> 9; |
|
- | 139 | ||
- | 140 | JetiBox_printfxy(0,0,"%3iN %3iR +N",n, r); |
|
- | 141 | JetiBox_printfxy(0,1,"%3iG +R -N -R",g); |
|
- | 142 | //1 |
|
- | 143 | ||
- | 144 | ||
- | 145 | } |
|
- | 146 | ||
- | 147 | void Menu_Info(uint8_t key) |
|
- | 148 | { //0123456789ABCDEF |
|
- | 149 | ||
- | 150 | JetiBox_printfxy(0,0,"%3i=Hovergas",HoverGas); |
|
- | 151 | JetiBox_printfxy(0,1,"%3i=HG/4 %3i=Gas",HoverGas/4,StickGas); |
|
- | 152 | } |
|
- | 153 | ||
- | 154 | void Menu_spoti1(uint8_t key) |
|
- | 155 | { //0123456789ABCDEF |
|
- | 156 | ||
- | 157 | JetiBox_printfxy(0,0,">%3i=Serialpot1",PPM_in[13]); |
|
- | 158 | JetiBox_printfxy(0,1," %3i=Serialpot2",PPM_in[14]); |
|
- | 159 | if(key== JETIBOX_KEY_UP) PPM_in[13] = PPM_in[13]+1; |
|
- | 160 | if(key== JETIBOX_KEY_DOWN) PPM_in[13] = PPM_in[13]-1; |
|
- | 161 | } |
|
- | 162 | ||
- | 163 | void Menu_spoti2(uint8_t key) |
|
- | 164 | { //0123456789ABCDEF |
|
- | 165 | ||
- | 166 | JetiBox_printfxy(0,0," %3i=Serialpot1",PPM_in[13]); |
|
- | 167 | JetiBox_printfxy(0,1,">%3i=SPo %3i",PPM_in[14],key); |
|
- | 168 | if(key== JETIBOX_KEY_UP) PPM_in[14] = PPM_in[14]+5; |
|
- | 169 | if(key== JETIBOX_KEY_DOWN) PPM_in[14] = PPM_in[14]-5; |
|
- | 170 | } |
|
- | 171 | ||
- | 172 | //#define JETIBOX_KEY_UP 0x2F |
|
- | 173 | //#define JETIBOX_KEY_DOWN 0x4F |
|
- | 174 | //1 |
|
- | 175 | ||
Line 94... | Line 176... | ||
94 | 176 | ||
95 | 177 | ||
96 | // ----------------------------------------------------------- |
178 | // ----------------------------------------------------------- |
97 | // the menu topology |
179 | // the menu topology |
Line 113... | Line 195... | ||
113 | 3 - 0 - 1 - 2 - 3 - 0 |
195 | 3 - 0 - 1 - 2 - 3 - 0 |
Line 114... | Line 196... | ||
114 | 196 | ||
Line 115... | Line 197... | ||
115 | */ |
197 | */ |
116 | 198 | ||
117 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
199 | const MENU_ENTRY JetiBox_Menu[] PROGMEM= |
118 | { // l r u d pHandler |
200 | { // l r u d pHandler links rechts up down |
119 | {3, 1, 0, 0, &Menu_Status }, // 0 |
201 | {9, 1, 0, 0, &Menu_Status }, // 0 /// |
120 | {0, 2, 1, 1, &Menu_Temperature }, // 1 |
202 | {0, 2, 1, 1, &Menu_Temperature }, // 1 |
- | 203 | {1, 3, 2, 2, &Menu_Battery }, // 2 |
|
- | 204 | {2, 4, 3, 3, &Menu_PosInfo }, // 3 |
|
- | 205 | //1 |
|
- | 206 | {3, 5, 4, 4, &Menu_Current }, // 4 /// |
|
- | 207 | {4, 6, 5, 5, &Menu_SetPoint }, // 5 /// |
|
- | 208 | {5, 7, 6, 6, &Menu_Integal }, // 6 /// |
|
- | 209 | {6, 8, 7, 7, &Menu_Info }, // 7 /// |
|
- | 210 | {7, 9, 8, 8, &Menu_spoti1 }, // 8 /// |
|
- | 211 | {8, 0, 9, 9, &Menu_spoti2 }, // 9 /// |
|
- | 212 | ||
- | 213 | ||
121 | {1, 3, 2, 2, &Menu_Battery }, // 2 |
214 | |
Line 122... | Line 215... | ||
122 | {2, 0, 3, 3, &Menu_PosInfo }, // 3 |
215 | //1 |
123 | }; |
216 | }; |
124 | 217 | ||
Line 139... | Line 232... | ||
139 | break; |
232 | break; |
140 | case JETIBOX_KEY_RIGHT: |
233 | case JETIBOX_KEY_RIGHT: |
141 | item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item |
234 | item = pgm_read_byte(&JetiBox_Menu[item].right); //trigger to right menu item |
142 | break; |
235 | break; |
143 | case JETIBOX_KEY_UP: |
236 | case JETIBOX_KEY_UP: |
- | 237 | ||
- | 238 | jetivalue1=jetivalue1+5; |
|
- | 239 | ||
144 | item = pgm_read_byte(&JetiBox_Menu[item].up); //trigger to up menu item |
240 | item = pgm_read_byte(&JetiBox_Menu[item].up); //trigger to up menu item |
145 | break; |
241 | break; |
146 | case JETIBOX_KEY_DOWN: |
242 | case JETIBOX_KEY_DOWN: |
- | 243 | ||
- | 244 | jetivalue1=jetivalue1-5; |
|
- | 245 | ||
147 | item = pgm_read_byte(&JetiBox_Menu[item].down); //trigger to down menu item |
246 | item = pgm_read_byte(&JetiBox_Menu[item].down); //trigger to down menu item |
148 | break; |
247 | break; |
149 | default: |
248 | default: |
150 | break; |
249 | break; |
151 | } |
250 | } |