Skip to content

Commit 1932dfc

Browse files
committed
Clarify elements in readme
1 parent 894435e commit 1932dfc

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,18 @@ analog_write('A3', 64)
7474
Will generate a modulated signal on the specified Pin.
7575
Can be used to control small motors with low current needs as well as servo motors.
7676

77-
#### IMPORTANT
78-
79-
The numeric value for PIN_NUMBER is usually the processor's GPIO number, while values enclosed in quotes are "named pins" and are platform/implementation specific, not guaranteed to be valid.
80-
A `ValueError` exception with label "invalid pin" is thrown if the pin number or ID is not valid.
77+
> [!IMPORTANT]
78+
> The numeric value for PIN_NUMBER is usually the processor's GPIO number, while values enclosed in quotes are "named pins" and are platform/implementation specific, not guaranteed to be valid. A `ValueError` exception with label "invalid pin" is thrown if the pin number or ID is not valid.
8179
8280
### delay(MILLISECONDS)
8381

8482
Will halt the execution of your program for the amount of _milliseconds_ specified in the parameter.
8583
It is to be considered a code-blocking command.
8684

85+
```Python
86+
delay(1000) # Delay the execution for 1 second
87+
```
88+
8789
## Usage
8890

8991
The structure of an Arduino MicroPython program will look as follows:
@@ -137,7 +139,7 @@ Is run indefinitely until the program stops.
137139

138140
### cleanup()
139141

140-
Is run _once_ when the program stops.
142+
Is run _once_ when the program stops. This happen either when the user manually stops the execution of the program or if an error in the user code is thrown.
141143
It should contain code such as resetting the value of variables, stopping timers, causing threads to stop running.
142144

143145
A `cleanup()` enchanced version of our initial program would look like this
@@ -158,6 +160,9 @@ def cleanup():
158160
start(setup, loop)
159161
```
160162

163+
> [!NOTE]
164+
> `cleanup()` does not get called when the program stops because the hardware button on the board was pressed.
165+
161166
## Utilities
162167

163168
Some utility methods are provided and are still in development:

0 commit comments

Comments
 (0)