Start a new topic

4 pictures in the same place

HI,

for a multi language interface I'd like make visible only one picture (a small flag in this case) in a corner of the display.


The flags to choose from are 4 and they are, obviously, equal both in dimension and position on the screen.


So I have the problem to hide 3 pictures and to show 1.

I tried the methods (supposing p1 the picture) p1.setPic and p1.getPic without success.


To be clear I enclose a very simple arduino sketch and the relative HMI file.


What am I doing wrong?


Thanks for any help

ino
(2.02 KB)
HMI

There are 2 pages in the HMI file.

I'm referring to page 1.

Try the attached HMI - setting p0.pic solves the problem.

 

HMI
(29.1 KB)

Thanks for the answer.


In your example the switch is made through a touch press event.


I do not know how to send the command directly from arduino without any touch event.


I do not know how to achieve it with the Itead Arduino library - I simply do not use it, but directly via UART you could do a "Serial1.print("p0.pic=2ÿÿÿ". This example assumes your UART is Serial1 and the picture should be 2. YMMV

 

No, it doesn't work with Serial1.print("p0.pic=2ÿÿÿ");

I have 4 pictures :


NexPicture p1 = NexPicture(1, 7, "p1");

NexPicture p2 = NexPicture(1, 3, "p2");

NexPicture p3 = NexPicture(1, 4, "p2");

NexPicture p5 = NexPicture(1, 6, "p5");


To select let's say p2 that is on page=1 with id=3 and name "p2" I do not think that


Serial1.print("p2.pic=3ÿÿÿ");


will make the choice hiding the other flags.

I'm confused.

In any case thanks for your help.

Could it be you are mixing up the picture ID as seen in the editor with the picture objname?

Your "p1", "p2", "p3" and "p5" are objnames, the pictures proper are held independently.

If you look at the picture below, the picture objname here is "p0" (top right), whereas the currently assigned picture "p0.pic" has ID 0 as seen in the list down left:

image

 

Now it's clear and it works !!!


One thing, that may be of interest to someone else, from arduino you have to use the function


sendCommand("p1.pic=9");


assuming p1 as the object and 9 the number of the jpg in the editor.


Thanks a lot for your time and very kind co-operation.

If you are using the ITEAD Library, there is an example, CompPicture. p0.setPic(number) is the function to send from arduino. 

Login or Signup to post a comment