Skip to content

Commit

Permalink
add code example translations for micropython page
Browse files Browse the repository at this point in the history
note that these translations have been generated using Claude 3.5
  • Loading branch information
vke committed Jan 30, 2025
1 parent 42c597a commit 7316957
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
12 changes: 9 additions & 3 deletions doc/main/micropython/micropython.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Examples
Using constants for efficiency
******************************

.. literalinclude::
.. translated-literalinclude::
../../../examples/micropython/const.py

Checking free RAM
******************************

.. literalinclude::
.. translated-literalinclude::
../../../examples/micropython/memuse.py

This prints information in the format shown below. In this example for the
Expand All @@ -47,8 +47,14 @@ the variables in your code. ::
No. of 1-blocks: 4, 2-blocks: 2, max blk sz: 8, max free sz: 16103


Handling keyboard interrupts
******************************

.. translated-literalinclude::
../../../examples/micropython/keyboard_interrupt.py

Getting more memory statistics
******************************

.. literalinclude::
.. translated-literalinclude::
../../../examples/micropython/memstat.py
5 changes: 5 additions & 0 deletions examples/translations/de/micropython/const.py.comments
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# German translations for const.py comments
This value can be used here. Other files can import it too. = Dieser Wert kann hier verwendet werden. Andere Dateien können ihn auch importieren.
These values can only be used within this file. = Diese Werte können nur innerhalb dieser Datei verwendet werden.
You can read the constants as normal values. The compiler = Sie können die Konstanten wie normale Werte lesen. Der Compiler
will just insert the numeric values for you. = wird die numerischen Werte für Sie einsetzen.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# German translations for keyboard_interrupt.py comments
Initialize the motor. = Initialisiere den Motor.
Start moving at 500 deg/s. = Beginne die Bewegung mit 500 Grad/Sekunde.
If you click on the terminal window and press CTRL+C, = Wenn Sie auf das Terminal-Fenster klicken und STRG+C drücken,
you can continue debugging in this terminal. = können Sie das Debugging in diesem Terminal fortsetzen.
You can also do this to exit the script and enter the = Sie können dies auch tun, um das Skript zu beenden und das
terminal. Variables in the global scope are still available. = Terminal aufzurufen. Variablen im globalen Bereich sind weiterhin verfügbar.
For example, you can copy the following line to the terminal = Zum Beispiel können Sie die folgende Zeile in das Terminal kopieren,
to get the angle, because test_motor is still available. = um den Winkel zu erhalten, da test_motor noch verfügbar ist.
8 changes: 8 additions & 0 deletions examples/translations/de/micropython/memstat.py.comments
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# German translations for memstat.py comments
Get stack at start. = Stack-Zustand zu Beginn ermitteln.
Print REPL compiler optimization level. = REPL-Compiler-Optimierungsstufe ausgeben.
Print memory usage. = Speichernutzung ausgeben.
Print memory usage and a memory map. = Speichernutzung und Speicherkarte ausgeben.
Print interned string information. = Informationen zu internen Strings ausgeben.
Print interned string information and their names. = Informationen zu internen Strings und deren Namen ausgeben.
Check the stack. = Stack überprüfen.
2 changes: 2 additions & 0 deletions examples/translations/de/micropython/memuse.py.comments
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# German translations for memuse.py comments
Print memory usage. = Speichernutzung ausgeben.

0 comments on commit 7316957

Please sign in to comment.