How to draw vertical cursor, instead horizontal?

Hello,

I have this code who show me on TFT LCD display a value from encoder

T = map(t, 21, 100, 50, 212);
  tft.fillRect(XTInd + 71, YVolInd + 19 ,(2 + vol), 3, TFT_BLUE);
  tft.fillRect(XTInd + 71 + vol, YVolInd + 19 , 212 - (2 + vol), 3, TFT_WHITE);

this is horizontal line filled with colour of encoder position, and I need to draw it on vertical
please any tips is welcome ..

1 Like

Take a piece of paper.

Draw the horizontal cursor. Add the x,y coordinates of the top left hand corner of the cursor. Add the width and height of the horizontal cursor rectangle.

Now draw the vertical cursor. Add the x, y, w, h values for the BLUE and the x, y, w, h values for WHITE.

Seriously. Pencil, paper and a cup of tea is how you solve these problems.

If you try to do everything "in your head" you will just find that your head hurts.
With pencil and paper everything becomes clear

David.

2 Likes

allways, the simple solution is the better,
but, can I use coffee instead tea ? :slight_smile:
Thank you David!

1 Like

Tea is much better.

Mind you, I do drink the occasional coffee. Sometimes up to 5 in a year.

Seriously, any graphical problem becomes easy when you draw on paper.

David.

2 Likes

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.