From dee0d40a6d1804b7b4aae10937d3e9ff3f0bce78 Mon Sep 17 00:00:00 2001 From: Quentin Bolsee <quentinbolsee@hotmail.com> Date: Mon, 2 Oct 2023 19:45:29 -0400 Subject: [PATCH] explanations on the prints --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 796ced8..2ecf4dc 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,19 @@ values = d.read_inputs() print(values) # prints {2: 1, 6: 0, 15: 1} ``` -## Error handling +## Prints handling + +By default, print statements from the device are relayed and displayed as: + +```txt +MPY_PRINT@COM1:HELLO WORLD +``` + +These messages can be suppressed by passing `show_prints=False` when instantiating the device. + +For more complex message exchange, it's best to pass a string to the host computer with a `return` statement. + +## Exceptions handling Exceptions on the MicroPython side are turned into Python exceptions, which can help you debug the embedded code. You can catch them and react accordingly: -- GitLab