Alright so i got the menu working, i'll post the code if anyone is interested. One thing that would be nice to be able to do is to use both BLINK and PREC2 on the same "drawnumber", is this possible?
Code: Select all
array myPID[10]
z = 3*x-y
drawtext( 0, 0, "KISS Setup: PIDs", INVERS )
drawtext( 111, 0, "1/5", 0 )
drawtext( 50, 14, "P", 0 )
drawtext( 78, 14, "I", 0 )
drawtext( 106, 14, "D", 0 )
drawtext( 4, 25, "Roll", 0 )
drawtext( 4, 36, "Pitch", 0 )
drawtext( 4, 47, "Yaw", 0 )
drawnumber( 55, 25, myPID[1], rP )
drawnumber( 83, 25, myPID[2], rI )
drawnumber( 111, 25, myPID[3], rD )
drawnumber( 55, 36, myPID[4], pP )
drawnumber( 83, 36, myPID[5], pI )
drawnumber( 111, 36, myPID[6], pD )
drawnumber( 55, 47, myPID[7], yP )
drawnumber( 83, 47, myPID[8], yI )
drawnumber( 111, 47, myPID[9], yD )
if z = 1 then rP = BLINK
if z # 1 then rP = 0
if z = 2 then rI = BLINK
if z # 2 then rI = 0
if z = 3 then rD = BLINK
if z # 3 then rD = 0
if z = 4 then pP = BLINK
if z # 4 then pP = 0
if z = 5 then pI = BLINK
if z # 5 then pI = 0
if z = 6 then pD = BLINK
if z # 6 then pD = 0
if z = 7 then yP = BLINK
if z # 7 then yP = 0
if z = 8 then yI = BLINK
if z # 8 then yI = 0
if z = 9 then yD = BLINK
if z # 9 then yD = 0
if Event = EVT_LEFT_FIRST then y += 1
if Event = EVT_RIGHT_FIRST then y -= 1
if x < 1 then x = 1
if x = 4 then x = 1
if y > 2 then y = 2
if y < 0 then y = 0
if Event = EVT_MENU_BREAK then x += 1
if Event = EVT_DOWN_FIRST then myPID[z] -= 1
if Event = EVT_UP_FIRST then myPID[z] += 1
if Event = EVT_EXIT_BREAK then goto done
if Event = EVT_BTN_BREAK then goto done
stop
done:
finish