How frequently do you need to check the status of the pin? Can you tolerate jitter? The appropriate answer depends on your use case.
if you have long loops of execution, you could break them up into smaller pieces, If the method returns to the main kivy event loop it will check and run the methods that are scheduled.
Here are a few other solutions to consider:
I’m surprised to hear having a popup open is impacting the clock schedule. I’m going to create a little test to see if that is true.
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/ce96573c-47b8-48f4-8f08-7f7f2932c556n%40googlegroups.com.
Here is a small test I put together. I do not see the state of the Popup impacting the Clock.schedule_interval.
# Does having a popup open stop the Clock.schedule_interval method?
from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
from time import asctime
kv = """
#: import Factory kivy.factory.Factory
<TestPop@Popup>:
title: 'Does Time Stop?'
size_hint: .7,.7
RelativeLayout:
Button:
text: 'Dismiss'
on_release: root.dismiss()
size_hint: None, None
size: 100, 48
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
BoxLayout:
Button:
text: 'Open Popup'
on_release: Factory.TestPop().open()
"""
class TestPopTimeApp(App):
def build(self):
return Builder.load_string(kv)
def on_start(self):
Clock.schedule_interval(self.print_time, 1)
def print_time(self, dt):
print(asctime())
TestPopTimeApp().run()
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/606f1a96.1c69fb81.178d5.adfaSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/CsFJsXCm7DU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/606f1a96.1c69fb81.178d5.adfaSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
If already have another process reading the signal, using schedule interval to read that signal every 100ms or perhaps 250ms should work fine.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/CANN_ggkfyMCgUpwgeOViMzP4xxLkGL-ULfxUrVOZjBgYtJYOdw%40mail.gmail.com.