diff options
author | Damien George <damien@micropython.org> | 2021-12-15 11:49:22 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-12-15 11:49:22 +1100 |
commit | d9d67adef1113ab18f1bb3c0c6204ccb210a27be (patch) | |
tree | c1806e1109c043c89023253472d11909ccec7fa9 /docs/pyboard/tutorial | |
parent | 5ca56aaf166c3e7cda178dfe809f8caf599b1dff (diff) |
docs: Remove trailing spaces and convert tabs to spaces.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'docs/pyboard/tutorial')
-rw-r--r-- | docs/pyboard/tutorial/accel.rst | 6 | ||||
-rw-r--r-- | docs/pyboard/tutorial/leds.rst | 2 | ||||
-rw-r--r-- | docs/pyboard/tutorial/repl.rst | 2 | ||||
-rw-r--r-- | docs/pyboard/tutorial/reset.rst | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/docs/pyboard/tutorial/accel.rst b/docs/pyboard/tutorial/accel.rst index 58170e74f..dff71f2ee 100644 --- a/docs/pyboard/tutorial/accel.rst +++ b/docs/pyboard/tutorial/accel.rst @@ -29,7 +29,7 @@ We will start by using the accelerometer to turn on a light if it is not flat. : while True: x = accel.x() - if abs(x) > SENSITIVITY: + if abs(x) > SENSITIVITY: light.on() else: light.off() @@ -61,7 +61,7 @@ use the ``y()`` value and more LEDs we can turn the pyboard into a spirit level. while True: x = accel.x() - if x > SENSITIVITY: + if x > SENSITIVITY: xlights[0].on() xlights[1].off() elif x < -SENSITIVITY: @@ -72,7 +72,7 @@ use the ``y()`` value and more LEDs we can turn the pyboard into a spirit level. xlights[1].off() y = accel.y() - if y > SENSITIVITY: + if y > SENSITIVITY: ylights[0].on() ylights[1].off() elif y < -SENSITIVITY: diff --git a/docs/pyboard/tutorial/leds.rst b/docs/pyboard/tutorial/leds.rst index 05f3b619e..63acc63ce 100644 --- a/docs/pyboard/tutorial/leds.rst +++ b/docs/pyboard/tutorial/leds.rst @@ -47,7 +47,7 @@ Here, n keeps track of the current LED and every time the loop is executed we cy One problem you might find is that if you stop the script and then start it again that the LEDs are stuck on from the previous run, ruining our carefully choreographed disco. We can fix this by turning all the LEDs off when we initialise the script and then using a try/finally block. When you press CTRL-C, MicroPython generates a VCPInterrupt exception. Exceptions normally mean something has gone wrong and you can use a try: command to "catch" an exception. In this case it is just the user interrupting the script, so we don't need to catch the error but just tell MicroPython what to do when we exit. The finally block does this, and we use it to make sure all the LEDs are off. The full code is:: leds = [pyb.LED(i) for i in range(1,5)] - for l in leds: + for l in leds: l.off() n = 0 diff --git a/docs/pyboard/tutorial/repl.rst b/docs/pyboard/tutorial/repl.rst index 973d1846a..b28d9cd57 100644 --- a/docs/pyboard/tutorial/repl.rst +++ b/docs/pyboard/tutorial/repl.rst @@ -73,7 +73,7 @@ indicate that you should type the text after it at the prompt. In the end, once you have entered the text ``print("hello pyboard!")`` and pressed Enter, the output on your screen should look like it does above. -If you already know some python you can now try some basic commands here. +If you already know some python you can now try some basic commands here. If any of this is not working you can try either a hard reset or a soft reset; see below. diff --git a/docs/pyboard/tutorial/reset.rst b/docs/pyboard/tutorial/reset.rst index 0cd5ac21c..59a3cd82a 100644 --- a/docs/pyboard/tutorial/reset.rst +++ b/docs/pyboard/tutorial/reset.rst @@ -21,7 +21,7 @@ To enter safe mode, do the following steps: 4. The LEDs will then cycle green to orange to green+orange and back again. 5. Keep holding down USR until *only the orange LED is lit*, and then let go of the USR switch. -6. The orange LED should flash quickly 4 times, and then turn off. +6. The orange LED should flash quickly 4 times, and then turn off. 7. You are now in safe mode. In safe mode, the ``boot.py`` and ``main.py`` files are not executed, and so |