You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using dual-state buttons, the Nextion firmware immediately changes the state of the button on touch. So if you start a gesture on a dual-state button then the button has an incorrect state after the gesture is detected. I fixed this by adding the following code to invert the state of the button again when a gesture is detected:
These few lines of code are added to the Timer Event code in the following location:
//
// Movement > 100px => SWIPE
if(dsq>10000)
{
if(b[tc0.val].type==53) // Swipe triggered, restore dual state button state
{
b[tc0.val].val=b[tc0.val].val^1
}
if(dx>100)
{
//>>
gest_type=1 // right
//page 0 // <- CUSTOM*** live action here
// t1.txt=">>" // ***DEGBUG/DEMO
}else if(dx<-100)
Normally I would have created a PR, but unfortunately HMI files are binary files. Instead of updating the Tips_and_Tricks.HMI file I thought it would be better to just create an issue with the solution.
The text was updated successfully, but these errors were encountered:
Great work on the gesture detection!
When using dual-state buttons, the Nextion firmware immediately changes the state of the button on touch. So if you start a gesture on a dual-state button then the button has an incorrect state after the gesture is detected. I fixed this by adding the following code to invert the state of the button again when a gesture is detected:
These few lines of code are added to the Timer Event code in the following location:
Normally I would have created a PR, but unfortunately HMI files are binary files. Instead of updating the Tips_and_Tricks.HMI file I thought it would be better to just create an issue with the solution.
The text was updated successfully, but these errors were encountered: