PymateIO-Delaying: Difference between revisions

From pymate.io wiki
Jump to navigation Jump to search
Line 2: Line 2:


== Abstract ==
== Abstract ==
The "[[Pymate-cycle-timing|Cycle Timing]]" tutorial state the following
The "[[Pymate-cycle-timing|Cycle Timing]]" tutorial state the following:


{{dbox-gray|<br />'''NEVER USE BLOCKING INSTRUCTION''' in the mainloop<br /></br />}}
{{dbox-gray|<br />'''NEVER USE BLOCKING INSTRUCTION''' in the mainloop<br /></br />}}


because this lock the code execution in a waiting state... whereas critical operation may requires quick reaction from the script.
Blocking instruction locks the script execution in a waiting state... whereas critical operation may requires quick reaction from the script.


{{dbox-red|<br />The '''sleep()''', '''sleep_ms()''' are '''BLOCKING INSTRUCTIONS'''.<br/>They should '''never be used''' in your script, neither in the mainloop<br /></br />}}
{{dbox-red|<br />The '''sleep()''', '''sleep_ms()''' are '''BLOCKING INSTRUCTIONS'''.<br/>They should '''never be used''' in your script, neither in the mainloop<br /></br />}}

Revision as of 16:36, 29 June 2026


Abstract

The "Cycle Timing" tutorial state the following:


NEVER USE BLOCKING INSTRUCTION in the mainloop

Blocking instruction locks the script execution in a waiting state... whereas critical operation may requires quick reaction from the script.


The sleep(), sleep_ms() are BLOCKING INSTRUCTIONS.
They should never be used in your script, neither in the mainloop



PymateIO all right reserved © 2026 - Written by MCHobby for PymateIO