Skip to main content
Associate III
October 26, 2023
Solved

Cannot draw a full-screen line with a TouchGFX-generated project

  • October 26, 2023
  • 6 replies
  • 5476 views

For an STM32H747i-DISCO board (800x480 lcd), I have used TouchGFX Designer v4.22.1 to create a very simple project with a box and static graph. The white box was maximized to the full screen. The static graph was untouched.

I imported this project into CubeIDE v1.13.2.

I want to be able to draw 799 horizontal line segments on the lcd. I am getting close but cannot get the resulting line to reach across the entire screen. It gets about 15% across and then stops.

The starting point of this short line can be moved to the right by adding a constant to 'segmentCounter' in  graph1.addDataPoint( segmentCounter , 240 );, but the length of the line doesn't change.

Any hints to what I am doing wrong would be appreciated. The attached code should draw 799 one-pixel line line segments. Attached are Screen1View.cpp and .hpp, plus a picture of the display. 

    This topic has been closed for replies.
    Best answer by JTP1

    Okey. I guess you must set the number of data points to 799 instead of 100 (default) in the tgfx designer graph1 properties.

    Im not sure can this number of points be changed by code, the array size seems to statically allocated in view base class hpp.

    Br JTP

    6 replies

    Graduate II
    October 26, 2023

    Hello Bob

    What if you dont add data to graph in every tick ? Now there comes lots of data. Maybe test first by adding 799 points just once.

    I guess SegmentCounter is initialized automatically to zero, even youre not initializing it. Some big value on first time could cause problems, so maybe worth testing to initialize it also.

    Br JTP

     

    Associate III
    October 26, 2023

    @JTP1 , I added segmentCounter=0 before the loop starts. I also made it so the data is added to the graph only once, and I verified this by moving the led toggle to inside the loop (it now only turns on and never turns off). 

    Neither of these changes had any effect. The line is still short, but it was worth trying your suggestion. It's a strange problem.

    JTP1Best answer
    Graduate II
    October 26, 2023

    Okey. I guess you must set the number of data points to 799 instead of 100 (default) in the tgfx designer graph1 properties.

    Im not sure can this number of points be changed by code, the array size seems to statically allocated in view base class hpp.

    Br JTP