Announcement

Collapse
No announcement yet.

How to put an initial value in a slider or a trackbar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to put an initial value in a slider or a trackbar

    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.

  • #2


    I think if you initially set iYAW to 90 it will display half way.

    Perhaps have a look at how some of the samples work (eg. File, Samples, Picaso Visi, SlideTrack)
    Mark

    Comment


    • #3


      Thank you. I will try it.

      Comment


      • #4
        This is so good.

        Comment

        Working...
        X