summaryrefslogtreecommitdiff
path: root/docs/pyboard/tutorial/leds.rst
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-06-04 23:53:26 +0100
committerDamien George <damien.p.george@gmail.com>2015-06-04 23:53:26 +0100
commit3eece29807f5257091271229dbf41543646eb4e4 (patch)
treeee9590731400cd2e777dc70d82cc75e14b235fe4 /docs/pyboard/tutorial/leds.rst
parent601cfea6a3901e0faeaf7aa4a25df6fd6594208f (diff)
docs: Change "Micro Python" to "MicroPython" in all places in docs.
Diffstat (limited to 'docs/pyboard/tutorial/leds.rst')
-rw-r--r--docs/pyboard/tutorial/leds.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/pyboard/tutorial/leds.rst b/docs/pyboard/tutorial/leds.rst
index 2105580e8..763eedf01 100644
--- a/docs/pyboard/tutorial/leds.rst
+++ b/docs/pyboard/tutorial/leds.rst
@@ -44,7 +44,7 @@ Next we will set up an infinite loop that cycles through each of the LEDs turnin
Here, n keeps track of the current LED and every time the loop is executed we cycle to the next n (the % sign is a modulus operator that keeps n between 0 and 3.) Then we access the nth LED and toggle it. If you run this you should see each of the LEDs turning on then all turning off again in sequence.
-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, Micro Python 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 Micro Python 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::
+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: