Modifications

Sauter à la navigation Sauter à la recherche
1 708 octets ajoutés ,  22 mai 2016 à 18:26
Page créée avec « {{WIPY-NAV}} {{traduction}} == Obtenir une ligne de commande REPL == REPL stands for Read Evaluate Print Loop, and is the name given to the interactive MicroPython promp... »
{{WIPY-NAV}}

{{traduction}}

== Obtenir une ligne de commande REPL ==
REPL stands for Read Evaluate Print Loop, and is the name given to the interactive MicroPython prompt that you can access on the WiPy. Using the REPL is by far the easiest way to test out your code and run commands. You can use the REPL in addition to writing scripts in {{fname|main.py}}.

To use the REPL, you must connect to the WiPy either via [[|telnet], or with a USB to serial converter wired to one of the two UARTs on the WiPy. To enable REPL duplication on UART0 (the one accessible via the expansion board) do:

<nowiki>>>> from machine import UART
>>> import os
>>> uart = UART(0, 115200)
>>> os.dupterm(uart)</nowiki>

Place this piece of code inside your boot.py so that it’s done automatically after reset.

== Avec Windows ==
First you need to install the FTDI drivers for the expansion board’s USB to serial converter. Then you need a terminal software. The best option is to download the free program PuTTY: [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html putty.exe].

{{underline|'''In order to get to the telnet REPL:'''}}

Using putty, select {{fname|Telnet}} as connection type, leave the default port (23) and enter the IP address of your WiPy (192.168.1.1 when in {{fname|WLAN.AP}} mode), then click open.

{{underline|'''In order to get to the REPL UART:'''}}

Using your serial program you must connect to the COM port that you found in the previous step. With PuTTY, click on “Session” in the left-hand panel, then click the “Serial” radio button on the right, then enter you COM port (eg COM4) in the “Serial Line” box. Finally, click the “Open” button.

{{WIPY-TRAILER}}
32 920

modifications

Menu de navigation