FEATHER-CHARGER-MICROPYTHON-SERIAL-REPL

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

For most MicroPython boards you can access the MicroPython REPL (read-evaluate-print loop) over their USB serial connections. Be sure to first follow any instructions and install drivers specific to your board to ensure you can access the USB serial connection:

Note the WiPy board REPL is only accessible over its wireless interface with telnet. Follow the WiPy instructions for connecting to the telnet REPL instead of the steps below for accessing with a serial terminal.

Determine the name of the serial port for your board. It's easiest to look at the serial ports with the board disconnected

  • on Windows check Device Manager under the Ports (COM/LPT) node,
  • or on Mac OSX/Linux run the ls /dev/tty.* command in a terminal,

Then connect the board and look at the serial ports again to find the newly added port.

On Windows you'll want to use a tool like PuTTY to connect to the serial port. Download and run PuTTY, then configure it to use a serial connection to the board's COM port at 115200 baud similar to as shown below:

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

{{{2}}}
Crédit: AdaFruit Industries www.adafruit.com

On Linux or Mac OSX the screen command can be used to connect to the serial port. Run the following command to connect at 115200 baud:

screen /dev/tty.board_name 115200

Where /dev/tty.board_name is the name of the board's serial port.

When you're done using screen most versions of it allow you to exit by pressing Ctrl-a then k then y or presing Ctrl-a then typing :quit and pressing enter.

After you're connected to the serial REPL try pressing enter to confirm you see the >>> prompt. You can also type help() and press enter on most boards to see basic usage information.

If you can't get a >>> prompt to appear try pressing Ctrl-c a couple times to interrupt any running program on the board.

That's all there is to connecting to the board's serial REPL, you're ready to start typing in and running MicroPython code!



Source: MicroPython Basics: How to Load MicroPython on a Board
Créé par Tony DiCola pour AdaFruit Industries.

Traduit par Meurisse D. pour MCHobby

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com