You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learn/02.microcontrollers/01.digital-pins/digital-pins.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The pins on the Arduino can be configured as either inputs or outputs. This doc
8
8
9
9
## Properties of Pins Configured as INPUT
10
10
11
-
Arduino (Atmega) pins default to inputs, so they don't need to be explicitly declared as inputs with pinMode() when you're using them as inputs. Pins configured this way are said to be in a **high-impedance state**. Input pins make extremely small demands on the circuit that they are sampling, equivalent to a series resistor of 100 megohm in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing [a capacitive touch sensor](https://playground.arduino.cc/Code/CapacitiveSensor), reading an LED as a [photodiode](https://playground.arduino.cc/Learning/LEDSensor), or reading an analog sensor with a scheme such as [RCTime.](https://arduino.cc/en/Tutorial/RCtime)
11
+
Arduino (Atmega) pins default to inputs, so they don't need to be explicitly declared as inputs with pinMode() when you're using them as inputs. Pins configured this way are said to be in a **high-impedance state**. Input pins make extremely small demands on the circuit that they are sampling, equivalent to a series resistor of 100 megohm in front of the pin. This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing [a capacitive touch sensor](https://playground.arduino.cc/Code/CapacitiveSensor), reading an LED as a [photodiode](https://playground.arduino.cc/Learning/LEDSensor), or reading an analog sensor with a scheme such as [RCTime](/tutorials/generic/capacitance-meter).
12
12
13
13
This also means however, that pins configured as pinMode(pin, INPUT) with nothing connected to them, or with wires connected to them that are not connected to other circuits, will report seemingly random changes in pin state, picking up electrical noise from the environment, or capacitively coupling the state of a nearby pin.
Copy file name to clipboardExpand all lines: content/micropython-course/course/01.introduction-python/02.intro-to-micropython.md
+43-15Lines changed: 43 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ author: 'Karl Söderby'
3
3
hero_image: "./hero-banner.png"
4
4
micropython_type: "101"
5
5
featured: micropython-101
6
-
title: 'Introduction to MicroPython'
6
+
title: '2. Introduction to MicroPython'
7
7
description: 'Learn about the Arduino platform'
8
8
---
9
9
@@ -146,39 +146,67 @@ For example, to use a module for a specific sensor, we need to install it **exte
146
146
147
147
### Install External Modules
148
148
149
-
To install an external module, we are going to use something called `mip`. With `mip`, we can install a module on the board directly, by connecting to Wi-Fi and downloading the module directly to the board. So how do we do this?
149
+
To install an external module, we are going to use a package manager called `mip`. With `mip`, we can install a module on the board by connecting to Wi-Fi® and downloading the module directly to the board. Installing external modules is done in two steps:
150
150
151
-
Below is a script that first connects to Wi-Fi®, and then downloads a specific module. In this case, we will provide a URL to a file stored on GitHub (the raw file). In this case, we will install the `lis3dh` module, which will be used later on in this course.
151
+
1. Establish a Wi-Fi connection.
152
152
153
-
Please note that you need to add your own Wi-Fi® network and password in the `WIFI_NETWORK` and `WIFI_PASSWORD` fields.
153
+
2. Download the module from a specific URL using `mip`.
154
+
155
+
To connect to your local Wi-Fi you can upload the following script to `boot.py` file. We choose `boot.py` because we want to make sure our board connects to the internet as soon as it boots up.
156
+
157
+
**Connect to Wi-Fi**
158
+
159
+

160
+
161
+
***Please note that you need to add your own Wi-Fi network and password in the `WIFI_NETWORK` and `WIFI_PASSWORD` fields.***
Once you run the script successfully, you will have installed the module on your board.
199
+
Press run and you should see the following inside the REPL:
200
+
201
+

202
+
203
+
In this case, we will provide a URL to a file stored on GitHub (the raw file). The script installs the `lis3dh` module, which will be used later on in this course.
204
+
205
+
You can verify that the module was installed correctly by pressing `Files` and checking inside the `lib` folder. You should see a file called `lis3dh.py` inside.
206
+
207
+

208
+
209
+
When asked later in the course to install external modules simply paste the provided script into `main.py` and press run.
182
210
183
211
### Removing Modules
184
212
@@ -215,9 +243,9 @@ OSError: -202
215
243
216
244
Some things to check are:
217
245
- Did you enter your network credentials properly?
218
-
- Did you already connect to Wi-Fi®?
246
+
- Did you already connect to Wi-Fi?
219
247
220
-
If the error persist, you can try to "soft-reset" the board, by clicking the **"Reset"** button, and run the script again.
248
+
If the error persists, you can try to "soft-reset" the board, by clicking the **"Reset"** button, and run the script again.
Copy file name to clipboardExpand all lines: content/micropython-course/course/02.installation/installation-tools.md
+5-13Lines changed: 5 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ author: 'Jacob Hylen'
3
3
hero_image: "./hero-banner.png"
4
4
micropython_type: "101"
5
5
featured: micropython-101
6
-
title: 'MicroPython Installation Guide'
6
+
title: '3. MicroPython Installation Guide'
7
7
description: 'Learn how to install a code editor needed to program your board with MicroPython.'
8
8
---
9
9
@@ -33,15 +33,7 @@ First, [download the app here](https://labs.arduino.cc/en/labs/micropython). It
33
33
34
34
If you're on macOS, move the application to your **Applications** folder.
35
35
36
-
**2. Put the Board in Bootloader Mode**
37
-
38
-
Before we can install MicroPython, we need to place our board in a "bootloader" mode as we call it. This will make it possible to send a new firmware to it.
39
-
40
-
Connect your board to your computer, and connect B1 to GND with a jumper wire, tweezers, or something else metallic you have handy. Once you see a green light on the board, press the reset button on the board. If you remove the connection between B1 and GND, you should see a dim purple light if this step was successful. If not, then try again.
41
-
42
-

43
-
44
-
**3. Download the Firmware Installer**
36
+
**2. Download the Firmware Installer**
45
37
46
38
The **Firmware Installer** program will help install MicroPython on your board.
47
39
@@ -51,21 +43,21 @@ First [download the app here](), and extract the files to a folder on your compu
51
43
52
44
If you're on macOS, move the application to your **Applications** folder.
53
45
54
-
**4. Flash Firmware**
46
+
**3. Flash Firmware**
55
47
56
48
Now open the Firmware Installer tool, select the Arduino Nano ESP32, and press **"Install MicroPython"**. Wait for the installer to do its magic and after some seconds, we are ready to go!
57
49
58
50

59
51
60
52
If the installer doesn't find the MicroPython firmware automatically, you can download it manually from [here](./assets/nanoesp32_micropython.bin)
61
53
62
-
**5. Connect your Code Editor and Board**
54
+
**4. Connect your Code Editor and Board**
63
55
64
56
In the Arduino Lab for MicroPython app, press **connect** in the top left corner and choose the serial port that comes up. This is your Nano ESP32.
65
57
66
58

67
59
68
-
**6. Verify**
60
+
**5. Verify**
69
61
70
62
Now, to verify things are working as they should, copy the script script below into your `main.py` file, and run it by clicking the **"Run"** button.
0 commit comments