issue198:micro-ci
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue198:micro-ci [2023/10/29 07:00] – d52fr | issue198:micro-ci [2023/10/31 17:47] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
Greetings again, fellow Beings! | Greetings again, fellow Beings! | ||
- | Usually, I have a plan for what I’m going to write about each month and this month is a normal month. | + | Usually, I have a plan for what I’m going to write about each month and this month is a normal month. AND, and as normal, the original plan 80% of the time is not what actually gets into the article. |
- | I WAS going to give an update on the WIO terminal and the progress that I’ve made on the screen display coding. | + | I WAS going to give an update on the WIO terminal and the progress that I’ve made on the screen display coding. However, as you will see, stats don’t lie. |
- | On October 6, 2023, Micropython.org released version 1.21. This is a major upgrade, just as 1.20 was. | + | On October 6, 2023, Micropython.org released version 1.21. This is a major upgrade, just as 1.20 was. |
Just some of the things that have changed in version 1.21 include (from the release notes) : | Just some of the things that have changed in version 1.21 include (from the release notes) : | ||
“This release of MicroPython sees the renaming of built-in modules to remove the u-prefix, a new deflate module with optional compression support, the introduction of board variants, switching of the esp32 port to use IDF 5 together with improved heap management, support for BLE on RPi Pico W boards, and STM32H5xx support. The project is also now using codespell and ruff to improve code quality. New boards added in this release are: ARDUINO_NANO_ESP32 and UM_NANOS3 (esp32 port), ADAFRUIT_METRO_M7 (mimxrt port), ARDUINO_PORTENTA_C33 and VK_RA6M5 (renesas-ra port), ADAFRUIT_METRO_M4_EXPRESS (samd port), NUCLEO_L4A6ZG and STM32H573I_DK (stm32 port).”** | “This release of MicroPython sees the renaming of built-in modules to remove the u-prefix, a new deflate module with optional compression support, the introduction of board variants, switching of the esp32 port to use IDF 5 together with improved heap management, support for BLE on RPi Pico W boards, and STM32H5xx support. The project is also now using codespell and ruff to improve code quality. New boards added in this release are: ARDUINO_NANO_ESP32 and UM_NANOS3 (esp32 port), ADAFRUIT_METRO_M7 (mimxrt port), ARDUINO_PORTENTA_C33 and VK_RA6M5 (renesas-ra port), ADAFRUIT_METRO_M4_EXPRESS (samd port), NUCLEO_L4A6ZG and STM32H573I_DK (stm32 port).”** | ||
+ | |||
+ | Micropython 1.21 est disponible ! | ||
+ | |||
+ | Encore une fois, salutations, | ||
+ | |||
+ | Habituellement, | ||
+ | |||
+ | J' | ||
+ | |||
+ | Le 6 octobre 2023, Micropython.org a publié la version 1.21. Il s'agit d'une mise à niveau majeure, tout comme l'a été la version 1.20. | ||
+ | |||
+ | Voici quelques-unes des choses qui ont changé dans la version 1.21 (extraites des notes de version) : | ||
+ | |||
+ | « Cette version de MicroPython voit le renommage des modules intégrés pour supprimer le préfixe u, un nouveau module, deflate, avec un support optionnel de la compression, | ||
+ | |||
**To load it onto your board of interest, download the latest build (https:// | **To load it onto your board of interest, download the latest build (https:// | ||
Ligne 18: | Ligne 33: | ||
This will get you the file manager window that you can drag and drop the new firmware into. | This will get you the file manager window that you can drag and drop the new firmware into. | ||
- | Assuming you are running Thonny, once the microcontroller reboots you’ll see the new version information in the REPL. Otherwise, when you plug into the board and go enter the REPL, you’ll see the new version. | + | Assuming you are running Thonny, once the microcontroller reboots you’ll see the new version information in the REPL. Otherwise, when you plug into the board and go enter the REPL, you’ll see the new version. |
I’ll try to break down just some of the “generic” enhancements and we’ll look at some of them in future articles. | I’ll try to break down just some of the “generic” enhancements and we’ll look at some of them in future articles. | ||
Ligne 24: | Ligne 39: | ||
ESP-NOW | ESP-NOW | ||
- | According to the espressif | + | According to the espressif (https:// |
ESP-NOW is a kind of connectionless Wi-Fi communication protocol that is defined by Espressif. In ESP-NOW, application data is encapsulated in a vendor-specific action frame and then transmitted from one Wi-Fi device to another without connection.** | ESP-NOW is a kind of connectionless Wi-Fi communication protocol that is defined by Espressif. In ESP-NOW, application data is encapsulated in a vendor-specific action frame and then transmitted from one Wi-Fi device to another without connection.** | ||
- | **I’ve been reading about ESP-NOW for a while, and have wanted to test it, but between time constraints and other projects, I’ve just never gotten around to playing. | + | Pour le charger sur la carte qui vous intéresse, téléchargez la dernière version (https:// |
+ | |||
+ | machine.bootloader() | ||
+ | |||
+ | Vous obtiendrez ainsi la fenêtre du gestionnaire de fichiers dans laquelle vous pourrez glisser et déposer le nouveau firmware. | ||
+ | |||
+ | Si vous utilisez Thonny, une fois que le microcontrôleur aura redémarré, | ||
+ | |||
+ | Je vais essayer de détailler quelques-unes des améliorations « génériques » et nous en examinerons certaines dans de futurs articles. | ||
+ | |||
+ | ESP-NOW | ||
+ | |||
+ | Selon espressif (https:// | ||
+ | ESP-NOW est un type de protocole de communication Wi-Fi, sans connexion, défini par Espressif. Dans ESP-NOW, les données d' | ||
+ | |||
+ | |||
+ | **I’ve been reading about ESP-NOW for a while, and have wanted to test it, but between time constraints and other projects, I’ve just never gotten around to playing. Now that it is fully supported by Micropython, | ||
Enhanced support for python f-strings | Enhanced support for python f-strings | ||
- | Micropython has supported “normal” python f-strings for a while, but for the life of me, I can’t find any information as to what version was the first to get f-strings. | + | Micropython has supported “normal” python f-strings for a while, but for the life of me, I can’t find any information as to what version was the first to get f-strings. That having been said, there have been some additions to the f-string support. Mainly support for conversion specifiers like “!r”. |
If you are not familiar with conversion specifiers, take a look at the following snippet (previous page, bottom right). | If you are not familiar with conversion specifiers, take a look at the following snippet (previous page, bottom right). | ||
- | This is the “old” way to print strings. | + | This is the “old” way to print strings. The output from the print statement (passing which=1) would look like this… |
I2C configuration: | I2C configuration: | ||
+ | |||
+ | J'ai lu des articles sur ESP-NOW depuis un certain temps, et j'ai voulu le tester, mais entre les contraintes de temps et d' | ||
+ | |||
+ | Support amélioré pour les f-strings en python | ||
+ | |||
+ | Micropython supporte les f-strings python « normales » depuis un certain temps, mais pour ma part, je n' | ||
+ | |||
+ | Si vous n' | ||
+ | |||
+ | Il s'agit de l'« ancienne » façon d' | ||
+ | |||
+ | I2C configuration: | ||
+ | |||
**Now, if we change the print statement to use f-strings, it would look like this… | **Now, if we change the print statement to use f-strings, it would look like this… | ||
- | print(f" | + | print(f" |
This output looks identical to the “old” way. | This output looks identical to the “old” way. | ||
Ligne 52: | Ligne 96: | ||
I2C configuration: | I2C configuration: | ||
- | So why bother. | + | |
+ | So why bother. Well, the answer is that you can use str(i2c) or repl(i2c) and get the same kind of output. But, the strings returned by the two functions, which most times will look the same, are two different types.** | ||
+ | |||
+ | Maintenant, si nous modifions l' | ||
+ | |||
+ | print(f" | ||
+ | |||
+ | Cette sortie semble identique à l'« ancienne » méthode. | ||
+ | |||
+ | Pour essayer le nouveau drapeau de conversion « !r », vous le coderiez de la manière suivante : | ||
+ | |||
+ | print(f" | ||
+ | |||
+ | Et, devinez quoi, la sortie est exactement la même encore une fois. | ||
+ | |||
+ | I2C configuration: | ||
+ | |||
+ | Alors, pourquoi le faire ? La réponse est que vous pouvez utiliser str(i2c) ou repl(i2c) et obtenir le même type de résultat. Mais les chaînes renvoyées par les deux fonctions, qui se ressemblent le plus souvent, sont de deux types différents. | ||
**Max Brenner (https:// | **Max Brenner (https:// | ||
Ligne 60: | Ligne 122: | ||
BLE in RPi-W | BLE in RPi-W | ||
- | BLE has officially been added in Micropython 1.21 for the RPi-W board. | + | BLE has officially been added in Micropython 1.21 for the RPi-W board. While this has been in the nightly builds for a while, it now is in the official release. We’ll be looking at this in future articles. |
- | | + | |
- | So that’s it for this month. | + | So that’s it for this month. I know this is shorter than normal, but I’m saving up for next month. |
Until then, as always; stay safe, healthy, positive and creative!** | Until then, as always; stay safe, healthy, positive and creative!** | ||
+ | |||
+ | Voyez ce que dit Max Brenner (https:// | ||
+ | |||
+ | Les indices suivants (ci-dessous) peuvent vous aider à décider quand utiliser lequel : | ||
+ | |||
+ | BLE dans RPi-W | ||
+ | |||
+ | BLE a été officiellement ajouté à Micropython 1.21 pour la carte RPi-W. Bien que c' | ||
+ | |||
+ | C'est donc tout pour ce mois. Je sais que c'est plus court que d' | ||
+ | |||
+ | D'ici là, comme toujours, restez en sécurité, en bonne santé, positifs et créatifs ! | ||
issue198/micro-ci.1698559232.txt.gz · Dernière modification : 2023/10/29 07:00 de d52fr