New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback question #20
Comments
Hi @vahithosan This requires calls of the Both functions are currently not implemented in this micropython lib. It would make sense to change to an async UART communication with the display and run this |
Thanks for your answer. I will also use uart with async. When the buttons are pressed, I send strings like print "page1" print "page2".
I have one more question. Can we change the variable in a non-open page? For example, can we change the value on page 2 when page 1 is open? I couldn't change.(The variables are set global) |
I assume it would be more efficient to create the The actual root cause is the same name of your three I don't have a setup here at the moment, but maybe you can try it like this. page1 = NexPage(nh, 1, 0, "page1") # NexHardware, page ID, component ID, name
page2 = NexPage(nh, 2, 0, "page2")
page3 = NexPage(nh, 3, 0, "page3")
# use a different unique name per NexNumber object
p1n0 = NexNumber(nh, 1, 8, "n1") # NexHardware, page ID, component ID, unique name
p2n0 = NexNumber(nh, 2, 8, "n2")
p3n0 = NexNumber(nh, 3, 8, "n3")
async def receiver():
sreader = asyncio.StreamReader(uart)
while True:
res = await sreader.read(8)
print('Recieved', res)
if res==b'PAGE01':
page1.show()
p1n0.setValue(55)
elif res==b'PAGE02':
page2.show()
p2n0.setValue(25)
elif res==b'PAGE03':
page3.show()
p3n0.setValue(35) |
Thanks. I will try |
@vahithosan may you can provide the full code to run this simple example, like the complete |
I have just started. That's all for now, but I'll post again when I'm done.
I don't use component id on buttons because password is one page. If the password matches, there will be a page transition. Touch press event in Nextion |
I simply tried.
While on page 2, I tried to change the value on page 3, it did not change.
I was able to open and change page 3. Is this how Nextion displays work?
|
I was try like this yesterday
I wrote page name before object #Page3
Its working (variable change other page) |
@vahithosan thanks for the update! Sound great. I'll update the docs with your finding and code for callbacks. |
Hi. Thanks for sharing this library. I have a question. How can call function on esp32 with nextion button.
The text was updated successfully, but these errors were encountered: