diff --git a/content/micropython/02.micropython-course/course/03.python-cc/python-cc.md b/content/micropython/02.micropython-course/course/03.python-cc/python-cc.md index 5e11e8bbb4..1d412c7b5f 100644 --- a/content/micropython/02.micropython-course/course/03.python-cc/python-cc.md +++ b/content/micropython/02.micropython-course/course/03.python-cc/python-cc.md @@ -107,7 +107,7 @@ Now take a look at what happens after each statement. Notice the empty space jus 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! Now since we already defined `x` to be `5+5`, the terminal will of course print: -- `"x is larger than 10"` +- `"x is exactly 10"` ## While Loop diff --git a/content/micropython/02.micropython-course/course/07.internet-of-things/01.internet-of-things.md b/content/micropython/02.micropython-course/course/07.internet-of-things/01.internet-of-things.md index e1a3cf5c5c..b30d8859eb 100644 --- a/content/micropython/02.micropython-course/course/07.internet-of-things/01.internet-of-things.md +++ b/content/micropython/02.micropython-course/course/07.internet-of-things/01.internet-of-things.md @@ -95,7 +95,7 @@ To do this, we can edit our `boot.py` file. Remember, the code on this file is t ![Select the Boot.py file.](assets/bootfile.png) -Then, in the `boot.py` file, we can past the Wi-Fi connection code that we just previously. +Then, in the `boot.py` file, we can use the Wi-Fi connection code that we used previously. ```python """ @@ -104,6 +104,10 @@ It will automatically run when you start your board, and connects to the Wi-Fi network specified. """ +import network + +WIFI_NETWORK='YOUR_NETWORK_NAME' +WIFI_PASSWORD='YOUR_NETWORK_PASSWORD' wlan = network.WLAN(network.STA_IF) wlan.active(True) @@ -177,7 +181,7 @@ Once we run the script, after a while, we should be receiving the response. This We now have a device that is capable of accessing the weather from anywhere in the world! -## Exercise 2: Internet Clock +## Exercise 3: Internet Clock In this exercise, we will make a request to something called an network time protocol (NTP) server. @@ -193,7 +197,7 @@ TIMESTAMP = 2208988800 # Create new socket client = usocket.socket(usocket.AF_INET, usocket.SOCK_DGRAM) client.bind(("", 8080)) -#client.settimeout(3.0) +client.settimeout(3.0) # Get addr info via DNS addr = usocket.getaddrinfo("pool.ntp.org", 123)[0][4]