Skip to content

Commit a29952f

Browse files
Merge pull request #2035 from arduino/benjamindannegard/micropython-course-fixes
[MKC-1703] Fixes for the Micropython course
2 parents 3f2d019 + 3eaf355 commit a29952f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

content/micropython/02.micropython-course/course/03.python-cc/python-cc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Now take a look at what happens after each statement. Notice the empty space jus
107107
Anything inside of this indentation will execute if the statement is met, and this is a fundamental principle that is used in every Python program that you write!
108108

109109
Now since we already defined `x` to be `5+5`, the terminal will of course print:
110-
- `"x is larger than 10"`
110+
- `"x is exactly 10"`
111111

112112
## While Loop
113113

content/micropython/02.micropython-course/course/07.internet-of-things/01.internet-of-things.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ To do this, we can edit our `boot.py` file. Remember, the code on this file is t
9595

9696
![Select the Boot.py file.](assets/bootfile.png)
9797

98-
Then, in the `boot.py` file, we can past the Wi-Fi connection code that we just previously.
98+
Then, in the `boot.py` file, we can use the Wi-Fi connection code that we used previously.
9999

100100
```python
101101
"""
@@ -104,6 +104,10 @@ It will automatically run when
104104
you start your board, and connects
105105
to the Wi-Fi network specified.
106106
"""
107+
import network
108+
109+
WIFI_NETWORK='YOUR_NETWORK_NAME'
110+
WIFI_PASSWORD='YOUR_NETWORK_PASSWORD'
107111

108112
wlan = network.WLAN(network.STA_IF)
109113
wlan.active(True)
@@ -177,7 +181,7 @@ Once we run the script, after a while, we should be receiving the response. This
177181

178182
We now have a device that is capable of accessing the weather from anywhere in the world!
179183

180-
## Exercise 2: Internet Clock
184+
## Exercise 3: Internet Clock
181185

182186
In this exercise, we will make a request to something called an network time protocol (NTP) server.
183187

@@ -193,7 +197,7 @@ TIMESTAMP = 2208988800
193197
# Create new socket
194198
client = usocket.socket(usocket.AF_INET, usocket.SOCK_DGRAM)
195199
client.bind(("", 8080))
196-
#client.settimeout(3.0)
200+
client.settimeout(3.0)
197201

198202
# Get addr info via DNS
199203
addr = usocket.getaddrinfo("pool.ntp.org", 123)[0][4]

0 commit comments

Comments
 (0)