Modifications

Sauter à la navigation Sauter à la recherche
46 octets ajoutés ,  21 avril 2025 à 23:43
Ligne 75 : Ligne 75 :  
async def loop( din ):
 
async def loop( din ):
 
     """ called again and again (like Arduino) """
 
     """ called again and again (like Arduino) """
−
     # User script here  
+
     # Asynchronous user script here  
    
din.setup( setup=None, loop=loop )
 
din.setup( setup=None, loop=loop )
Ligne 83 : Ligne 83 :       −
The {{fname|setup()}} call is used to specify a ''setup'' method (optional) and a ''loop'' method to be called.
+
The {{fname|setup()}} call is used to specify a ''setup'' method (optional) and a ''loop'' method to be used by the AsyncIO implementation.
   −
The optional ''setup'' method is called to specify some initialization routine. It is quite useful to declare additional sensor, additional components for your project.
+
The optional ''setup'' parameter is used to specify some initialization routine. ''setup'' is quite useful to declare sensors and components in your project.
    
Once {{fname|din.run()}} is called:
 
Once {{fname|din.run()}} is called:
−
* the {{fname|def setup( din )}} is called once (if any)
+
* the {{fname|def setup( din )}} is called once (if any declared)
 
* the {{fname|async def loop( din )}} is continuously executed!  
 
* the {{fname|async def loop( din )}} is continuously executed!  
    
The ''loop'' execution can even be monitored with a watchdog.  
 
The ''loop'' execution can even be monitored with a watchdog.  
   −
The {{fname|din}} parameter passed to ''setup'' and ''loop'' method provide a full access to all the behaviors and features of the DIN case.
+
The ''din'' parameter passed to {{fname|setup}} and {{fname|loop}} methods provide a full access to all the behaviors and features of the DIN case.
    
In normal condition, the {{fname|din.run()}} never exits. However, exit can happens:
 
In normal condition, the {{fname|din.run()}} never exits. However, exit can happens:
32 908

modifications

Menu de navigation