Jump to content

Recommended Posts

Posted

Hello,

When I compiled the Dial widget example(win32_dial), I got those errors.

..\dial.c(127): error:  #167: argument of type "point (*)[4]" is incompatible with parameter of type "point *"
..\dial.c(127): error:  #167: argument of type "point (*)[4]" is incompatible with parameter of type "const point *"

What can I do to fix them?

I use freeRTOS and STM32F429-disco board.

 

Thanks.

Posted

Hello Alan,

Yes, you can of course use an image for the needle. The example is really just that: An example. It's a custom widget and you can customize it to fit your needs.
However, the current version of the µGFX library doesn't provide any high-level API for image rotation so you'd have to handle the image rotation yourself. But looking at your image it doesn't look like this needs to be an image anyway. I see two polygons and a circle :) 

Posted

Hi Joel,

 

I just ran this dial widget example on my STM32F429 board.

Icons are showed correctly on LCD except the needle.

Needle is never displayed.

 

So I went back to run the gdisp polygons demo.

I found polygon could be draw by only using MATRIXFIXED2D API.

I do not know the reason why MATRIXFLOAT2D API could not.:(

 

If I use MATRIXFIXED2D API to draw needle in the dial widget example, will the result be same?

 

Hope you can give some advice.

Thanks.

Posted

Hello Alan,

The gdispFillConvexPoly() function can only operate on integer points because the points represent pixel coordinates. There is no such thing as half a pixel. When rendering a shape to the framebuffer. Of course you can use float matrix operations prior to that - that's no problem.

 

1 hour ago, Alan Chang said:

Icons are showed correctly on LCD except the needle.

Needle is never displayed.

I assume that you enabled the convex polygon support as you wouldn't be able to compile otherwise? Did the /demos/modules/gdisp/polygons demo work on your hardware?

Posted

Hi Joel,

 

Yes, I can run the  /demos/modules/gdisp/polygons demo.

MOV_0248.mp4

Just I need to turn the MATRIXFIXED2D API.

 

I guess I only can use MATRIXFIXED2D on my board.

Let me modify the Dial widget example code and try again.

 

Thanks.

 

 

 

 

Posted

The most likely reason the fixed2d calls work but the float3d calls don't would be that there is something wrong with the compiler or c library support for floating point for your cpu.

This could be as simple as not setting the compiler options correctly for your cpu.

The fixed2d routines will invariably be much faster anyway than floating point operations (albiet slightly less accurate ).

Posted

Hello,

 

Thanks for your quite reply.

I remember I could run the  demos\modules\gdisp\streaming successfully before.

The note mentioned the demo uses floating point operations.

Also there is FPU inside STMF429.

 

Maybe there is setting issue in compiler or library  .   

I will check them soon.

 

Thanks.

Posted

Hello,

When I change to my dial image in dial widget example code, why do I get two needles?

DSC_0255.thumb.JPG.d71fa71b1d32eead85869f32309cd776.JPG

I think one of them is from "dialCreate".

How can I fix it?

// Dial widget
	wi.g.show = TRUE;
	wi.g.width = 160;
	wi.g.height = 80;
	wi.g.y = 70;
	wi.g.x = 50;
	wi.g.parent = 0;
	wi.text = "Dial Widget";
	//gdispImageOpenFile(&_imgDialFace, "rsc/dial_face.bmp");
	gdispImageOpenFile(&_imgDialFace, "rsc/scale150x76.bmp");

	gdispImageCache(&_imgDialFace);
	_ghDial = dialCreate(0, &wi, &_imgDialFace);
	
	dialSetAngle(_ghDial, DIAL_INITIAL_ANGLE);

 

Thanks.

Posted

It appears that your image is simply too small. Make sure that the image is of the same size as the widget itself. The current rendering function of the dial widget that you're using doesn't do a solid-color clear of the area but instead relies on the fact that the image covers the entire widget area.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...