Search found 8 matches
- Sat Apr 17, 2021 9:19 pm
- Forum: General Discussion and Questions
- Topic: Time control in a while loop
- Replies: 2
- Views: 1696
Time control in a while loop
My program: import machine import utime import sys letzte_zeit = 0 diff_erreicht = 0 def zeit_diff(schlafen): global letzte_zeit if utime.ticks_diff(utime.ticks_ms(), letzte_zeit) >= schlafen: letzte_zeit = utime.ticks_ms() diff_erreicht = 1 return(diff_erreicht) while True: print("I am the main pr...
- Sat Apr 10, 2021 12:22 pm
- Forum: Drivers for External Components
- Topic: Problem with the interrupt
- Replies: 1
- Views: 2717
Re: Problem with the interrupt
So it works fine now.
by calling the callback 2 times in a row.
But I don't know why that is now.
I would be grateful for an explanation.
Code: Select all
if sendung == 1:
gesendet.irq(handler=int_handler)
n.check_data(nextion_callback)
n.check_data(nextion_callback)
But I don't know why that is now.
I would be grateful for an explanation.
- Fri Apr 09, 2021 8:03 pm
- Forum: Drivers for External Components
- Topic: Problem with the interrupt
- Replies: 1
- Views: 2717
Problem with the interrupt
The Lib nextion_dieter.py from machine import UART from micropython import const import ustruct COMMAND_PAGE_ID = 'page' COMMAND_COMPONENT = 'ref' COMMAND_CLICK = 'click' COMMAND_STOP_REFRESH = 'ref_stop' COMMAND_REFRESH_START = 'ref_star' COMMAND_GET = 'get' COMMAND_GET_PAGE = 'sendme' COMMAND_VISI...
- Fri Apr 09, 2021 5:23 pm
- Forum: Drivers for External Components
- Topic: Variable wird nicht übergeben
- Replies: 2
- Views: 2877
- Fri Apr 09, 2021 5:05 pm
- Forum: Drivers for External Components
- Topic: Variable wird nicht übergeben
- Replies: 2
- Views: 2877
Variable wird nicht übergeben
I think I'm out of the wind somewhere. import machine from machine import Pin import utime #here I create a variable sendung = 0 gesendet = machine.Pin(5) def int_handler(pin): sendung = 1 #everything is recognized correctly here and transmission is = 1 gesendet.irq(trigger=machine.Pin.IRQ_RISING, h...
- Thu Apr 01, 2021 5:09 pm
- Forum: Drivers for External Components
- Topic: Nextion Display
- Replies: 4
- Views: 5240
Re: Nextion Display
Another riddle? when I set the buffer to 14. After the first command from the display, my code stops. The second command continues my code. The next time it stops again. etc (65010401FFFFFF) = length 7 And if I set the (self.read_buffer, 7) then everything runs through without errors. The only probl...
- Thu Apr 01, 2021 3:18 pm
- Forum: Drivers for External Components
- Topic: Nextion Display
- Replies: 4
- Views: 5240
Re: Nextion Display
Yes Roberthh, I get the right answer sometimes. But most of the time processing stops when the lib is called. after if self.any (): And the command: chars = self.readinto (self.read_buffer, 100) is no longer executed Can I let the interruption continue with a call. Or set the timeout low? I don't kn...
- Thu Apr 01, 2021 12:54 pm
- Forum: Drivers for External Components
- Topic: Nextion Display
- Replies: 4
- Views: 5240
Nextion Display
I want a Nextion display with the Pico operate and have already found a good lib. https://github.com/michel-cf/micropytho ... nextion.py Sending commands to the Nextion also works great. But what I can't do at all is the callback method. My code: import machine import utime import nextion n = nextio...