I use Visi IDE and an uLCD-32PTU. I wish begin my program with an initial value in a slider or a trackbar.
#platform "uLCD-32PTU" #inherit "4DGL_16bitColours.fnc" #inherit "VisualConst.inc" #inherit "SLIDETRACK_persoConst.inc"
IDE with "paste code" give the code :
func moveYawSlide() var posn,n; // YAW 1.0 generated 21/01/2014 21:40:18 img_Show(hndl,iYAW) ; // show initialy, if required img_ClearAttributes(hndl, iYAW, I_TOUCH_DISABLE); // set to enable touch, only need to do this once posn := y - 32 ; // y - top - 8 if (posn < 0) posn := 180 ; // maxvalue-minvalue else if (posn > 154) // height - 17) posn := 0 ; else posn := 180 - 180 * posn / 154 ; // max-min - (max-min) * posn / (height-17) endif img_SetWord(hndl, iYAW, IMAGE_INDEX, posn); img_Show(hndl, iYAW); txt_MoveCursor(18, 0); print("yaw",[DEC3ZB] posn) ; posYaw := posn;endfunc
How can I put the slider at the middle of the range ?
Thank you and best regards.
#platform "uLCD-32PTU" #inherit "4DGL_16bitColours.fnc" #inherit "VisualConst.inc" #inherit "SLIDETRACK_persoConst.inc"
IDE with "paste code" give the code :
func moveYawSlide() var posn,n; // YAW 1.0 generated 21/01/2014 21:40:18 img_Show(hndl,iYAW) ; // show initialy, if required img_ClearAttributes(hndl, iYAW, I_TOUCH_DISABLE); // set to enable touch, only need to do this once posn := y - 32 ; // y - top - 8 if (posn < 0) posn := 180 ; // maxvalue-minvalue else if (posn > 154) // height - 17) posn := 0 ; else posn := 180 - 180 * posn / 154 ; // max-min - (max-min) * posn / (height-17) endif img_SetWord(hndl, iYAW, IMAGE_INDEX, posn); img_Show(hndl, iYAW); txt_MoveCursor(18, 0); print("yaw",[DEC3ZB] posn) ; posYaw := posn;endfunc
How can I put the slider at the middle of the range ?
Thank you and best regards.
Comment