Rushtp #5 - Nextion Intelligent - Photo Frame Algebraic Transition Effects
by Rushtp in Circuits > Electronics
491 Views, 0 Favorites, 0 Comments
Rushtp #5 - Nextion Intelligent - Photo Frame Algebraic Transition Effects
Background
In this project I will show how to create eleven transition effects. Eight will mimic the built-in effects I demonstrated in my last project. I have added three additional effects: Fade-in, Bouncing Out and Bunny Hops.
So let’s get started.
In my previous project, Rushtp #4 - Nextion Intelligent - Photo Frame Transition Effects, we enhanced the basic photo frame created in Rushtp #3 - Nextion Intelligent - Photo Frame ExPicture Files From the SD Card with the Nextion Editor built-in transition effects to make the photo changes glide-in from different directions.
- 0. Load
- 1. top fly into
- 2. bottom fly into
- 3. left fly into
- 4. right fly into
- 5. top left fly into
- 6. top right fly into
- 7. bottom left fly into
- 8. bottom right fly into
This had one disadvantage in that to activate the effects the Nextion screen page had to be refreshed at every photo change. I found this a little cumbersome scripting to trigger the effects.
I decided to take a look at how the fly into effects are created. So let’s explore the ExPicture exp0 object x and y co-ordinates
The x and y are attributes that define the top-left corner or origin of an object placed on the screen page.
I will demonstrate how these effects are achieved and give additional examples of some bespoke effects using the object attributes x and y. These co-ordinates can be changed with code during runtime.
Please note: This project can only be created on the Nextion Intelligent Series displays.
I am using the same Nextion Intelligent 7" Touch Screen (NX8048P070-011C) as I have in all my previous projects and will start from where we left off in in my Rushtp #3 - Nextion Intelligent - Photo frame ExPicture files from the SD Card project.
If you have not completed that project you can download the Nextion HMI file and Photo files for this project by following the instructions in Step 1 below.
Acknowledgments & References:
- Rod Pierce: Maths is Fun - Linear Equations
- A.Forrest: Maths Mutt - Maths Mutt Home - Quadratics
- Martijn: The Art of Code - How to Create Cool Bounce Effects Using a Loop
- Cheap Controls Tutorials - Nextion Component Names versus IDs
Table of Contents:
Step 1: Nextion Editor - Load The Rushtp #3 Photo Frame Project Files
Step 2: Nextion Editor - Shorthand Conventions I’ll be using...
Step 3: Nextion Editor - Creating A New Font
Step 4: Nextion Editor - The Hidden Zone
Step 5: Nextion Editor - Playing With The Coordinates
Step 6: Nextion Editor - Exploring The Algebra - x & y Linear Equations
Step 7: Nextion Editor – Fade-in Effect
Step 8: Nextion Editor - Bouncing Out
Step 9: Nextion Editor - Bunny Hops
Step 10: Nextion Editor - Automating The Transition
Step 11: Nextion Editor - Tap On The Screen To Toggle The Controls ON/OFF
Step 12: Nextion Editor - Add A Frame Delay Control 1 - 9 Seconds
Step 13: Nextion Editor - Upload To A Nextion Intelligent 7" Touch Screen
Step 14: Summing Up…
Step 15: Download Worked Example
Supplies
- Nextion Intelligent 7" Touch Screen (e.g. NX8048P070-011C)
- USB to TTL CP2102 UART Module 5Pin Serial Converter
- USB extender cable (3m)
- Nextion 7” Display DIY Enclosure (Optional)
- 20mm clear heat Shrink tube (Optional)
- Nextion Editor (Download)
- Nextion Editor Guide
- Nextion Instruction set
- Adobe Photoshop Elements (NOT Adobe Premiere Elements!)
- 32GB Micro SD Card (FAT32 format) Search
The Nextion display is connected using a USB to TTL CP2102 UART Module 5Pin Serial Converter.
The TFT File Output option works fine but the Upload option is easier to use (No fiddling around with the SD card).
If the Upload option does not work have a look at Rushtp #2 - Nextion Editor Serial Upload Not Working - Fixes to get it working.
Nextion Editor - Load the Rushtp #3 Photo Frame Project Files
I am starting where I left off in my Rushtp #3 - Nextion Intelligent - Photo frame ExPicture files from the SD Card project.
| If you have not completed that project you can download the Nextion HMI file and Photo files for this project using the links below. Note: This file has been saved as a .txt file because some web browsers will not allow .HMI files to be downloaded! You will have to rename the downloaded Rushtp3.txt file as Rushtp3.HMI before you can open it with the Nextion Editor. Photo-1.txt, Photo-2.txt, Photo-3.txt, Photo-4.txt, Photo-5.txt, Photo-6.txt, Photo-7.txt, Photo-8.txt, Photo-9.txt, Photo-10.txt, Photo-11.txt Note: These files have also been saved as a .txt files. Rename them as Photo-1.xi, Photo-2.xi,,,etc. Then copy them into a new "xi Photos" folder in the Nextion Editor Virtual SD Card folder. You will also have to copy the "xi Photos" folder onto the SD Card on the Nextion Intelligent Display before Uploading the Nextion TFT file.
Open the Rushtp3.HMI file in the Nextion Editor. and SaveAs Rushtp #5 - Nextion Intelligent - Photo Frame Algebraic Transition Effects.HMI. This file was developed for the Nextion Intelligent Series 7” display screen. To modify it for other size screen, or to include your own images, you will have to follow the whole Rushtp #3 - Nextion Intelligent - Photo Frame ExPicture Files From the SD Card project making adjustments for your screen size, and photos. |
Nextion Editor - Shorthand Conventions I’ll Be Using...
The Nextion Editor has a number of display areas that contain objects, actions, files or code.
- File
- Tools
- Toolbox
- Display
- Program.s
- Page
- Attribute
- Event
- Pictures
- Fonts
So, when referring to placing an object (e.g. Button, b0) I’ll use the following convention
(…this button is just an example and not one used in this project)
|
I am not going to explain ever piece of code we are using.
I leave it up you you to work it out. It is not that difficult, but I will explain what we are trying to achieve as we go along.
Nextion Editor – Creating a New Font
Stay in Rushtp #5 - Nextion Intelligent - Photo Frame Algebraic Transition Effects.HMI in the Nextion Editor.
Before we start adding buttons and other objects I want you to create a new font Arial16B. This should be font ID:2.
| Top Tool Bar |
|---|
| Tools, Font Generator, Attribute Height 16 Encoding utf-8 Font Atial Bold “ticked” Font Name Arial16B Generator font File Name Arial16B.zi Save When Progress: 100% OK Add the generated font Yes |
Nextion Editor - the Hidden Zone
The Nextion Intelligent 7" (NX8048P070-011C) page size is w800 x h480 pixels with the origin x=0 and y=0 in the top-left corner.
I have set the exPicture exp0 frame to the same size 800x480 to fill the page with the x and y coordinates set to 0, 0.
Let’s look at a bigger picture on an Excel scatter chart.
The chart axes are set to x = -800 to +1600 and y = -480 to +960. I have added a background image to demonstrate the location of the Nextion page.
Now consider what happens when the ExPicture frame has it’s x and y coordinates set outside the page range. As the origin coordinates are moved outside the visible area into the hidden zone the photo gets cropped.
To completely hide the photo we need explore the hidden zone outside the visible area and use the coordinate ranges:
x = -800 to +1600px
y = +480 to -960px
the visible area being:
x = 0 to 800px
y = 0 to 480px
Nextion Editor - Playing With the Coordinates
Assuming you have created Rushtp #5 - Nextion Intelligent - Photo Frame Algebraic Transition Effects.HMI from me previous projects (or downloaded Rushtp3.HMI in Step 1)…
Let’s move The existing browser object out of the way and add two sliders, a button and two numbers
Now resize the fbrowser0 box to w60 x h60 and drag it into the bottom of the display to get it out of the way.
The following additions to the Nextion file will allow us to move the origin of the ExPicture frame along with any of the photos we have selected.
Add these buttons from the Toolbox
|
|
The sliders are programmed to change the x and y coordinates around the extended range:
x = -800 to +1600px(2x the width of the Photo Frame exp0)
y = -480 to +960px (2x the height of the Photo Frame exp0)
Because the ExPicture frame origin is in it’s top-left corner we only need to move exp0.x from -800 to +800 so I have set the h0 slider max and minimum values to 1600 and 0 respectively. Then I set the slide value h0.val give a mid-point at 800. In the Touch Move Event script I have subtracted 800 from the mid-point value (800) to set exp0.x to 0 and n3.val to 000 (the number box has it’s display to length 3 for this).
Similarly the h1 slider max and Minimum values have been set to 960 and 0 respectively and the h1.val to 480, etc. so that we can move exp0.y from -480 to +480.
Add these sliders from the Toolbox and add the Touch Release Event scripts
|
|
Add this reset button from the Toolbox and add the Touch Release Event script to reposition the sliders back to x=000 and y=000.
| b4(Button) - Reset |
|---|
| Toolbox, Button, Attribute |
objname b4 vscope local font 2 txt Reset txt_maxl 10 x 22 y 80 w 80 h 30 |
| Event, Touch Move |
h0.val=800 n3.val=h0.val n3.val-=800 exp0.x=n3.val // h1.val=480 n4.val=h1.val n4.val-=480 exp0.y=n4.val |
Run the file in Debug to check everything works.
So far , So good!
(If things go wrong please recheck the object names and the Event coding).
Nextion Editor - Exploring the Algebra – X & Y Linear Equations
- 0. Load
- 1. top fly into
- 2. bottom fly into
- 3. left fly into
- 4. right fly into
- 5. top left fly into
- 6. top right fly into
- 7. bottom left fly into
- 8. bottom right fly into
Effect 1-4 use a simple linier equation to move the photo frame exp0 coordinates in vertical or horizontal lines.
| For example "top fly into": x = 0 and y = -480 to 0, step +10. The +10 sets the number of steps along the y axis and hence the speed the photo moves vertically. |
The 5-8 diagonal effects are created by incrementing both the x and y coordinates of the photo frame exp0.
| For example"top left fly into": x = -800 to 0, Step +10*800/480 and y = -480 to 0 step 10. The *800/480 is ensure the photo frame exp0 moves diagonally in accordance with the screen aspect ratio. |
To create the diagonal effects x needs to step +10*800/480 = +16.666 ̇ because of the Nextion screen aspect ratio (480x800). However, x has to be an integer so the script offsets with 16 and continues with step 17 in the loop exp0.x=0 after the coding script has run.
Acknowledgments & References:
- Martijn: The Art of Code - How to Create Cool Bounce Effects Using a Loop
- Cheap Controls Tutorials - Nextion Component Names versus IDs for a full explanation of IDs
First add a Text box t1 and a Number box n1 from the Toolbox.
The n1(Number) will used to display the effect number corresponding to the list above.
|
|
Add this button too and name it bID. It displays the Effect button ID so we can check they are sequenced correctly.
| bID(Number) |
|---|
| Toolbox, Nember, Attribute |
objname bID vscope local font 2 bco 2047 Pco 63488 val 0 len 0 format Decimal x 682 y 396 w 50 h 30 |
For reasons that I will explain later add the following buttons in sequence, One after the other. This will ensure that the button ID’s are sequential.
We will now create a grid of buttons to trigger each of these effects.
- 0. Load
- 1. top fly into
- 2. bottom fly into
- 3. left fly into
- 4. right fly into
- 5. top left fly into
- 6. top right fly into
- 7. bottom left fly into
- 8. bottom right fly into
(Just like buttons for the built-in effects I demonstrated in: Rushtp #4 - Nextion Intelligent - Photo Frame Transition Effects.HMI)
Add three more buttons for additional effects (We will program them in the later steps).
- 9. Fade-in
- 10. Bounce out right
- 11. Bunny hops
Note: the sequence numbers you create may differ from the ones I obtained. It does not matter as long as the all eleven button ID’s are in sequence.
I’ve also renamed the buttons e0, e1, e2, e3, etc. up to e11.
Load without any effects Button
|
Vertical or Horizontal Effect Buttons
|
|
|
|
Diagonal Effect Buttons
|
|
|
|
Now add The three more buttons for additional effects (We will program them in the later steps).
| e9(Button) Fade-in |
|---|
| Toolbox, Button, Attribute |
objname e9 vscope local font 2 txt "9" ixt_maxl 1 x 581 y 227 w 36 h 30 |
| e10(Button) Bouncing out |
|---|
| Toolbox, Button, Attribute |
objname e10 vscope local font 2 txt "10" ixt_maxl 2 x 581 y 247 w 36 h 30 |
| e11(Button) Bunny hops |
|---|
| Toolbox, Button, Attribute |
objname e11 vscope local font 2 txt "11" ixt_maxl 1 x 581 y 283 w 36 h 30 |
Right, now run Debug and press the Photos button to load a photo. Then press each of the Effect buttons 1 to 8 to test the transition effects.
Cool! The Photos run in straight lines.
(If things go wrong please recheck the coding from Step 6).
Nextion Editor - Fade-in Effect
Nextion editor objects have an Opaqueness attribute aph (0-127) that can be used to change the transparency of an object. In our case we can use it to fade in (or out) any photo displayed in the ExPicture frame exp0 we are using for the photo frame transition.
Add the following code to the Effect e9 button.
Transparency Effect Button
| e9(Button) Fade-in |
|---|
| Toolbox, Button, Attribute |
objname e9 vscope local font 2 txt "9" ixt_maxl 1 x 581 y 227 w 36 h 30 |
| Event, Touch Release Event |
| n1.val=9 bID.val=e9.id //-------------------------------------------------------- exp0.x=0 exp0.y=0 exp0.aph=1 while(exp0.aph<127) { exp0.aph=exp0.aph+2 delay=1 } //-------------------------------------------------------- delay=3000 //Hold the picture for 3 seconds |
Then run Debug and press the Photos button to load a photo. Then press each of the Effect button 9 to test the Fade-in effect.
Nextion Editor - Bouncing Out
The Excel graph displays a number of y=a+(x-b)2 parabolas (upside down U-shaped curves). The chart starts with a drop from the Nextion page x=0, y=0 coordinates to the screen baseline y=480. Then followed by a number of diminishing bounces out of the bottom-right of the screen.
Acknowledgments & References:Many thanks to the following tutorials on the internet…
- A.Forrest: Maths Mutt - Maths Mutt Home - Quadratics
- Martijn: The Art of Code - How to Create Cool Bounce Effects Using a Loop
In Martijn’s YouTube video he demonstrates how create multiple parabolas to make bounces.
In his chart he took note of the x value of the end of the first bounce where y = 0. Then set the start of the next bounce to that value. Doing the same setting each subsequent bounce start at the end of the previous bounce.
In my case I used an Excel scatter chart and adjusted the data values of a to set the height of the bounce. Then I adjusted the value of b until could I visually see in the chart I had moved the start of the next bounce to the end of the previous bounce along the y=480 base line. (I’m an engineer and like to find easy ways to achieve my goals).
If you look at the screen shot of the chart data you can see how the data aligns.
Note: the actual formular I used was y=a+(x-b)2/30. The division by 30 sets the bounce width to a visually pleasing shape for the graph. The bounce was too quick and pointy with lower values.
I used the constraints in a do while loop and an if condition statement to cut off the “Tails” of the bounces so the photos appear to bounce on the bottom of the screen.
Start coding…
Let’s start with a drop from the top-right of the picture frame followed by just one bounce. Copy and paste the following code into the button e10 Touch Release Event.
Bounce Effect Button
|
|
Run Debug and check the first bounce works.
Carry on coding the rest of the bounces…
To add the rest of the bounces. Just copy and paste this code below the existing Touch Release Event code.
|
|
|
|
Right, now run Debug and press the Photos button to load a photo. Then press Effect button 10 to test the full Bounce out transition effect.
Great! That got them bouncing.
(If things go wrong please recheck the coding from Step 8).
Nextion Editor - Bunny Hops
Here my aim was to create another bounce effect with an offset to make the photo frame bounce into the screen. In practice I found the coding more difficult than I intended.
However the resulting Bunny Hop effect works for me. So I kept it.
I used the constraints in a do while loop and an if condition statement to cut off the “Tails” of the bounces so the photos appear to bounce on the bottom of the screen. In actual fact the bounces start below the bottom of the screen.
Acknowledgments & References:Many thanks again to the following tutorials on the internet…
- A.Forrest: Maths Mutt - Maths Mutt Home - Quadratics
- Martijn: The Art of Code - How to Create Cool Bounce Effects Using a Loop
Get coding…
Let’s start with a drop from the top-right of the picture frame followed by just one bounce. Copy and paste the following code into the button e10 Touch Release Event.
Hop Effect Button
|
Run Debug and check the first hop works.
Carry on coding the rest of the hops…
To add the rest of the hops just copy and paste this code below the existing Touch Release Event code.
|
|
|
|
Now run Debug and press the Photos button to load a photo. Then press Effect button 11 to test all the Hops work and the photo stops at full screen.
Great! That got them hopping.
(If things go wrong please recheck the coding from Step 9).
Nextion Editor - Automating the Transition
To automatically add a transition effect as the photos changes we could adopt ether of the following options:
- Copy the Touch Release Event scripts from each of the effect buttons and paste them into a series of if and if else commands in the Photos button script.
- Trigger the effect button scripts from a button Touch Release Event using the click command.
As you might of guessed I will be going with option 2.
Now I can explain why I wanted you to add effect buttons in sequence, one after the other. This ensured that the button id’s are sequential from button e0 to e11.
In my case the ids start at 20 for e0 and rise to 31 for e11. To trigger the effect button scripts we will be using the click command. In The Nextion Instruction Set the click command can be used in two ways:
- click b0,1 // Trigger Touch Press Event of component with .objname b0
- click 4,0 // Trigger Touch Release Event of component with .id 4
Another feature we need to use is the Array[index] (p[ ] and b[ ] represent the page and button arrays):
- p[pageindex].b[component.id].attribute // global scope
- b[component.id].attribute // local scope on current page
For example to activate button whose id is 25 (i.e. e5 id=25):
- click 25,0
- or
- click b[25],0
Let’s test it out…
Add a new button from the Toolbox, in my case it is b3. Move it to the middle of the screen and change its attribute txt to “Test”. Now write the following code in the Touch Release Event box…
| b3(Button) Test | Here we are using the random function rand set to range 0 to 11 with randset to represent the effect buttons. The first effect button e0 has an id of 20. |
|---|---|
| Toolbox, Button, Attribute | |
objname b3 vscope local font 2 bco 2016 text "Test" ixt_maxl 10 x 368 y 254 w 50 h 30 | |
| Event, Touch Release Event | |
| randset 0,11 n1.val=rand y.val=0 click b[n1.val+20],0 |
Run Debug and press the Photos button to load a photo. Then repeatedly press and release the Test button and check everything works.
OK! Now random things are happening.
Continuing on with coding…
To link it up the automatic photo frame transitions we can add the test code to the Serial OFF/ON and Random OFF/ON button timer tm0 script. Timer tm0 was set up in the Rushtp #3 Photo Frame Project Files we downloaded in Step1. The timer triggers the photo changes so all we have to do is add out test code to the end of the Serial ON and Random ON condition scripts.
| tm0(Timer) |
|---|
| Toolbox, Button, Attribute |
objname tm0 vscope local tim 3000 ewn 1 |
| Timer Event |
| if(b1.txt=="Serial ON") { FileNr.val++ n0.val=FileNr.val covx FileNr.val,tFileNr.txt,0,0 if(FileNr.val>=fCount.val) { FileNr.val=0 } exp0.path="sd0/xi Photos/Photo-"+tFileNr.txt+".xi" randset 0,11 n1.val=rand click b[n1.val+20],0 } // -------------------------------------------------------- if(b2.txt=="Random ON") { randset 1,fCount.val FileNr.val=rand n0.val=FileNr.val covx FileNr.val,tFileNr.txt,0,0 exp0.path="sd0/xi Photos/Photo-"+tFileNr.txt+".xi" randset 0,11 n1.val=rand click b[n1.val+20],0 } |
Run Debug again.
Test the Serial OFF/ON and Randon OFF/ON buttons to check the photo changes and transition effects work.
Great! More random things are going on now.
*Now you can delete the Test button b3 and save the Nextion file*
Nextion Editor - Tap on the Screen to Toggle the Controls ON/OFF
Now the controls are all working it would be nice to hide them after the digital photo frame is running.
First add a new Text object t2, or copy and paste the t0 (“of”) object. Then edit the attributes to display the screen instructions. (For txt select multiline… to add the control text)
| t2(Text) |
|---|
| Toolbox, Text, Attribute objname T2 vscope global font 1 sta transparency pco 65522 txt “Tap on the screen to Toggle controls ON/OFF” txt_maxl 100 x 75 y 35 w 700 h 30 |
Now add the following code to exp0(ExPicture).
| exp0(ExPicture) |
|---|
| Toolbox, ExPicture, Attribute objname exp0 vscope global effect top fly into x 0 y 0 w 800 h 480 |
| Event, Touch Release Event if(visState.val==0) { vis b0,0 vis b1,0 vis b2,0 vis n0,0 vis t0,0 vis fCount,0 //----------------------------------------------------------------- vis n3,0 vis h0,0 vis b4,0 vis n4,0 vis h1,0 vis e0,0 vis e1,0 vis e2,0 vis e3,0 vis e4,0 vis e5,0 vis e6,0 vis e7,0 vis e8,0 vis e9,0 vis e10,0 vis e11,0 vis t1,0 vis n1,0 vis bID,0 vis t2,0 //----------------------------------------------------------------- visState.val=1 }else { vis b0,1 vis b1,1 vis b2,1 vis n0,1 vis t0,1 vis fCount,1 //----------------------------------------------------------------- vis n3,1 vis h0,1 vis b4,1 vis n4,1 vis h1,1 vis e0,1 vis e1,1 vis e2,1 vis e3,1 vis e4,1 vis e5,1 vis e6,1 vis e7,1 vis e8,1 vis e9,1 vis e10,1 vis e11,1 vis t1,1 vis n1,1 vis bID,1 vis t2, //----------------------------------------------------------------- visState.val=0 } |
Run Debug to ensure tapping the screen toggles the controls ON/OFF and it all works.
Nextion Editor - Add a Frame Delay Control 1 - 9 Seconds
The timer tm0 (Timer) was set to trigger every 3000 milliseconds (i.e. 3 seconds).
Well, we can change that value during run time in Debug by adding a Slider control to change the trigger time in the range 1 to 9.9 seconds.
Leave the timer tm0 (Timer) set to trigger every 3000 milliseconds. this will be the default setting.
Now carry out the following:
(I am not going to use my shorthand tables to show you the Attribute and Event settings. You should now be able to set them up yourself from the brief instructions below):
| • | Add t3(Text), x0(Xfloat) and t4(Text) objects from the Toolbox |
| - For all three objects set the sta=transparent, font=1, and pco=65535 white - Set t3’s xcen=Right and txt=“Frame delay” - Set t4’s xcen=Left and txt to “Seconds” (Adjust the txt_maxl, w and h values to suit) - Set the Xfloat x0.val to 3000 (Adjust the w and h values to suit) - Align the 3 objects in a clear space on the screen (Use the Align tools below the top menu bar) | |
| • | Add h2(Slider) |
| - Set it global, horizontal - bco = 0, bco1 = 0 and pco = 65535 - val = 3000, maxval = 9900 and minval = 1000 - In the Touch Move event add tm0.tim=h2.val and x0.val=h2.val/100 - position it below the line of text | |
| • | Add more code to the exp0(ExPicture) Touch Release Event to toggle these new controls ON/OFF |
| - vis t3,0 vis x0,0 vis t4,0 vis h2,0 - vis t3,1 vis x0,1 vis t4,1 vis h2,1 |
Right, now run Debug.
Set the slider to 1.0 seconds and set the Serial button to Serial ON. The picture increase the speed of the photo change.
Move the slider to 9.9 seconds and the picture change should slow down.
Finally click on the screen to toggle the controls ON/OFF.
Good! Everything should now be working.
(If things are not working out for you, you can download the project files – See Step 15)
Nextion Editor - Upload to a Nextion Intelligent 7" Touch Screen
Finally, select Upload to update the Nextion Intelligent 7" Touch Screen
In the Program.s tab above the display screen set baud=921600 //Configure baudrate.
Then I did an Upload with the Baud Rate set to 921600 onto the Nextion Intelligent 7" Touch Screen (e.g. NX8048P070-011C) using my USB to TTL CP2102 UART Module 5Pin Serial Converter.
…it took about 4 minutes! …so time to pour a cold beer.
PS: If you have not disconnected the touch screen and closed the Nextion Editor the next upload only takes a few seconds to complete.
Summing Up…
The Photo Frame Algebraic Transition Effects Work.
In this project I demonstrated how to create advanced transition effects based on algebraic formulas “x,y functions” controlling the ExPicture frame’s x and y values without having to use page refreshing.
I also demonstrated the function effects in MS Excel charts.
| In the next project, and the last in the Photo Frame series, I will show how to: |
Note: the Nextion display will not need to be re-programmed to add or change the photros. Just resize (800x480 pixels) and convert to “.xi” file format and put them on the SD Card.
Download Worked Example
You can download the Nextion HMI file and Photo files for this project using the links below.
| It is important that you read the notes shaded in green before starting downloading... Note: This file has been saved as a .txt file because some web browsers will not allow .HMI files to be downloaded! You will have to rename the downloaded Rushtp4.txt file as Rushtp5.HMI before you can open it with the Nextion Editor. Photo-1.txt, Photo-2.txt, Photo-3.txt, Photo-4.txt, Photo-5.txt, Photo-6.txt, Photo-7.txt, Photo-8.txt, Photo-9.txt, Photo-10.txt, Photo-11.txt Note: These files have also been saved as a .txt files. Rename them as Photo-1.xi, Photo-2.xi,,,etc. Then copy them into a new "xi Photos" folder in the Nextion Editor Virtual SD Card folder. You will also have to copy the "xi Photos" folder onto the SD Card on the Nextion Intelligent Display before Uploading the Nextion TFT file.
Open the Rushtp5.HMI file in the Nextion Editor. and SaveAs Rushtp #5 - Nextion Intelligent - Photo Frame Algebraic Transition Effects.HMI. This file was developed for the Nextion Intelligent Series 7” display screen. To modify it for other size screen, or to include your own images, you will have to follow the whole Rushtp #3 - Nextion Intelligent - Photo Frame ExPicture Files From the SD Card project making adjustments for your screen size, and photos. |