Modifications

Sauter à la navigation Sauter à la recherche
256 octets ajoutés ,  16 mai 2019 à 21:14
Ligne 16 : Ligne 16 :     
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
pyb.repl_uart( pyb.UART(1,9600) )
+
from machine import UART
 +
from os import dupterm
 +
 
 +
uart = UART( 1, 9600 )
 +
dupterm( uart )
 
</syntaxhighlight>
 
</syntaxhighlight>
    
= REPL Bluetooth permanent =
 
= REPL Bluetooth permanent =
 
Si le test est concluant, vous pouvez activer le REPL Bluetooth de façon permanente en saisissant le code suivant en première ligne de votre fichier {{fname|main.py}}  
 
Si le test est concluant, vous pouvez activer le REPL Bluetooth de façon permanente en saisissant le code suivant en première ligne de votre fichier {{fname|main.py}}  
 +
 +
Une bonne idée est d'allumer la LED bleue de la Pyboard. Cela permet de savoir qu'elle est sous tension --ET-- que la connexion USB-Bluetooth est prête.
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
pyb.repl_uart( pyb.UART(1,9600) )
+
from machine import UART
 +
from os import dupterm
 +
 
 +
uart = UART( 1, 9600 )
 +
dupterm( uart )
 +
pyb.LED(4).on() # Turn on the Blue LED
 
</syntaxhighlight>
 
</syntaxhighlight>
    
Gardez néanmoins à l'esprit qu'un programme fonctionnant (depuis {{fname|main.py}} bloque les interactions REPL (aussi via USB que via Bluetooth).
 
Gardez néanmoins à l'esprit qu'un programme fonctionnant (depuis {{fname|main.py}} bloque les interactions REPL (aussi via USB que via Bluetooth).
  −
[[Fichier:MicroPython-bluetooth-REPL-10.jpg]]
      
{{MicroPython-bluetooth-TRAILER}}
 
{{MicroPython-bluetooth-TRAILER}}
29 918

modifications

Menu de navigation