Skip to content

Commit 1266e37

Browse files
committed
Implement Nefeli's comments
1 parent ad730fe commit 1266e37

File tree

1 file changed

+6
-5
lines changed
  • content/hardware/03.nano/carriers/nano-motor-carrier/tutorials/nano-matlab-wifi-led

1 file changed

+6
-5
lines changed

content/hardware/03.nano/carriers/nano-motor-carrier/tutorials/nano-matlab-wifi-led/nanoMatlabWiFiLED.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ The goals of this project are:
4343

4444

4545
### Why MATLAB?
46-
MATLAB® is an educational and industrial programming platform used to analyse data, perform simulations and carry out model based designs. Through an interactive communication with an Arduino board, you can expand MATLAB's capabilities, while also gaining access to a wide range of math, engineering and plotting functions. Check out the capabilities of MATLAB® over on the [MathWorks website](https://www.mathworks.com/solutions.html#capabilities). In this tutorial, we will establish the connection with MATLAB via a USB and Wi-Fi connection.
46+
MATLAB® is an educational and industrial programming platform used to analyse data, perform simulations and carry out model based designs. Through an interactive communication with an Arduino board, you can expand MATLAB's capabilities, while also gaining access to a wide range of math, engineering and plotting functions. Check out the capabilities of MATLAB® over on the [MathWorks website](https://www.mathworks.com/solutions.html#capabilities). In this tutorial, we will establish the connection with MATLAB via a USB and Wi-Fi connection. The [MATLAB Support Package for Arduino Hardware](https://www.mathworks.com/matlabcentral/fileexchange/47522-matlab-support-package-for-arduino-hardware) must be installed (which may require a MathWorks account), in order to facilitate the communication between the MATLAB software on your computer and your Arduino board.
4747

48-
![Connection route to MATLAB](assets/nanoMatlabWiFiLED-01.png)
48+
![Connection route to MATLAB](assets/nanoMatlabWiFiLED-01.png)
4949

5050
### Static vs Dynamic IP Addressing
5151
When you connect your Arduino board, you should see the COM port under Device Manager. By referencing the COM port, you can create a two-way data link between your computer and the Arduino device. For a device connected on a network, we can use an Internet Protocol (IP) address to identify it. In the IPv4 standard, this is written as a series of four numbers such as `192.168.1.100`. By default, most routers are configured to assign a dynamic address via a Dynamic Host Configuration Protocol (DHCP). This means less configuration, but at the cost of the IP address changing. In order to reliably address your Arduino board, you may wish to utilise a static IP address. Once a static IP address is assigned, it will stay the same.
@@ -119,7 +119,7 @@ end
119119

120120
## Control LED over Wi-Fi with MATLAB
121121

122-
**1.** Firstly, make sure your Arduino board is connected via the USB cable. Run `clear a` to remove the previously created arduino object and then run the `arduinoSetup()` script again. This time, select the Wi-Fi option. You will see that a few options appear at the bottom left. Select your Wi-Fi encryption type and enter your SSID, password and port. By default, the Arduino board will obtain a dynamic IP from your router.
122+
**1.** Firstly, make sure your Arduino board is connected via the USB cable. Run `clear a` to remove the previously created arduino object and then run the `arduinosetup()` command again. This time, select the Wi-Fi option. You will see that a few options appear at the bottom left. Select your Wi-Fi encryption type and enter your SSID, password and port. By default, the Arduino board will obtain a dynamic IP from your router.
123123

124124
![Connection of Arduino over Wi-Fi to MATLAB](assets/nanoMatlabWiFiLED-10.png)
125125

@@ -146,7 +146,8 @@ end
146146

147147
If the code is not working, there are some common issues we can troubleshoot:
148148

149-
- Make sure to clear previous Arduino objects linked to the device.
149+
- Make sure to clear previous Arduino objects linked to the device. You can do this by running the command `clear a` where `a` is the Arduino object.
150+
- If you get the message `Unrecognized function or variable 'arduinosetup' ` ensure that you have installed the [MATLAB Support Package for Arduino Hardware](https://www.mathworks.com/matlabcentral/fileexchange/47522-matlab-support-package-for-arduino-hardware).
150151
- If the network requires login, you may be unable to connect. Contact your network administrator or use USB to connect to the board.
151152

152153

@@ -162,6 +163,6 @@ You can now control your Arduino Nano 33 IoT via MATLAB by a wired or wireless c
162163

163164
- Write a MATLAB function that allows you to change the speed based on input arguments.
164165

165-
- Use the `writePWMVoltage` function to control a LED on an external Pin.
166+
- Use the `writePWMVoltage()` function to control a LED on an external Pin.
166167

167168
- Try moving a DC/Servo motor via Wi-Fi.

0 commit comments

Comments
 (0)