Wednesday, August 23rd 2017, 10:02am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

tictactoe

Beginner

Date of registration: Sep 24th 2015

Posts: 14

1

Friday, September 25th 2015, 10:35pm

Problem in using GUI_CURSOR_SetPosition

Hi
I have a joystick with 2 analog output 0 volts to 3 volts as X and Y axis .I want to use ADC for moving the cursor on the lcd.At first, I want to set the position of the cursor manually .The size of the lcd is 7 inch with SSD1963 driver.
everything is good for showing text,button,icon,.... on the lcd , but when I use GUI_CURSOR_SetPosition() for changing the position of cursor on the lcd on the white background color , Black color line created after the cursor movement.I use WM_MOUSEOVER message for refreshing the window region as below:
WM_InvalidateWindow(WM_GetClientWindow(_hFrame));
But it does not work.
I think the problem is the reading the color of the background of lcd because of invalid setup the color format of lcd.

I setup the color section of LCDConf.c as below:
#define COLOR_CONVERSION GUICC_565
#define DISPLAY_DRIVER GUIDRV_FLEXCOLOR

Please help me to solve my problem

Regards

This post has been edited 1 times, last edit by "tictactoe" (Sep 25th 2015, 10:58pm)


SEGGER - Jörg

Super Moderator

Date of registration: Dec 20th 2007

Posts: 81

2

Friday, October 2nd 2015, 12:03pm

Hi,

I assume reading of the display does not work. If using GUIDRV_FlexColor it should either work with a display cache or it must kept sure that reading pixel data from the controller works right. You could check if reading works right by the following test:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
void _Test(void) {
  const int dx = 50;
  const int dy = 50;
  const GUI_COLOR aColor[] = { GUI_RED, GUI_GREEN, GUI_BLUE };
  const char * apText[] = {
	"Red", "Green", "Blue"
  };
  GUI_RECT Rect = { 0, 0, dx - 1, dy - 1 };
  int i;
  
  GUI_SetTextMode(GUI_TM_TRANS);
  for (i = 0; i < GUI_COUNTOF(aColor); i++) {
	GUI_SetColor(aColor[i]);
	GUI_FillRectEx(&Rect);
	GUI_SetColor(GUI_WHITE);
	GUI_DispStringInRect(apText[i], &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
	GUI_MoveRect(&Rect, dx, dy);
  }
  GUI_MoveRect(&Rect, -dx, -dy);
  GUI_InvertRect(dx / 4, dy / 4, Rect.x1 - dx / 4, Rect.y1 - dy / 4);
  GUI_MoveRect(&Rect, -dx, -dy);
  GUI_InvertRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
}


The attached screenshot should show the expected output.

Regards, Jörg
SEGGER - Jörg has attached the following image:
  • xxx.gif

tictactoe

Beginner

Date of registration: Sep 24th 2015

Posts: 14

3

Saturday, October 3rd 2015, 10:05pm

Hi,
Thanks you for the answer.
I test your code, but the white box is Violet. The joint's color of two box does not change and it seems that the violet box is on the top of other boxes .
So I think the reading pixel data from the controller does not work right.

Regards

tictactoe

Beginner

Date of registration: Sep 24th 2015

Posts: 14

4

Saturday, December 19th 2015, 11:04pm

color false

Hi Jörg
Sorry for late answering. At first I should say I am using emwin 5.26
I test your code again with my STM32F103 dev board.(LCD 7 inch with ssd1963)

The red box is showing blue
The green box is showing green
The blue box is showing red

Its the picture of your sample code


I attach the related files with my problem . please help me for the incorrect code settings.

Regards
SSD1963_lcdconf.zip

This post has been edited 2 times, last edit by "tictactoe" (Dec 19th 2015, 11:22pm)


tictactoe

Beginner

Date of registration: Sep 24th 2015

Posts: 14

5

Sunday, December 27th 2015, 9:28pm

Hi
Finally with some changes in ssd1963 and lcdconf files, the color was corrected and the result of the code in my hardware was as same as your result test.
But the color of the cursor is still black and the shape of the cursor was drawn on the screen.

Please help me to correct this.

Regards
Hamed