Modifications

Sauter à la navigation Sauter à la recherche
494 octets ajoutés ,  29 avril 2025 à 16:40
Ligne 11 : Ligne 11 :     
When setting the RUN_APP pin to the "Stop" position (so tied to ground) while the MyDin software is already running, the '''code may takes up to 3 seconds to terminates'''.
 
When setting the RUN_APP pin to the "Stop" position (so tied to ground) while the MyDin software is already running, the '''code may takes up to 3 seconds to terminates'''.
 +
 +
It is also a good practice to check the RUN_APP pin in the {{fname|boot.py}} startup file. This may allows debugging operations when Network operation goes wrong!
 +
 +
 +
<syntaxhighlight lang="python">
 +
from machine import Pin
 +
RUN_APP = Pin.board.GP3  # High=Run, Low=Stop
 +
 +
if Pin( RUN_APP, Pin.IN, Pin.PULL_UP ).value()==False:
 +
  print( '[BOOT] skip execution (RUN_APP is false)' )
 +
else:
 +
  print( '[BOOT] entering...' )
 +
  # >>> PLACE BOOT CODE HERE <<<
 +
  print( '[BOOT] exit' )
 +
</syntaxhighlight>
    
== Exception handling ==
 
== Exception handling ==
32 908

modifications

Menu de navigation