Monday, November 6, 2017

Arduino MKR1000 - Set Up Process

The next step of my IoT journey is to create a project using a Wi-Fi enabled Arduino. I chose the Arduino MKR1000, due to its built-in Wi-Fi capabilities. It cost around $35 plus shipping. I will also be using a connector cable that I found in the electrical lab at my university, since I realized as I started setup that I didn't have one. I would recommend purchasing one.


In this post I will record my experience setting up the Arduino and the Arduino IDE. I'll be using a Windows 8.1 PC. This is my first experience using Arduino.


I will be following this tutorial and noting all the places where there may be confusion while following it.


The tutorial uses version 1.6.8, but I will be using version 1.8.5 since it is the latest version at the time I downloaded it.


When downloading the Arduino IDE as instructed, I found it easier to use this source instead of the source given in the tutorial, since it will download an executable instead of a maze-like .zip file.


When asked to check if the driver is installed by going to the "device manager", know that the device manager is a stock application on Windows, not a part of the Arduino IDE.



Here is my Arduino MKR1000 connected to my laptop:




While uploading a sketch, I chose port COM6 instead of COM19, since that latter wasn't available in my version.


The tutorial completely skips the step about how to upload a sketch, which took me a few minutes to figure out. After selecting the proper port, you must go to Sketch -> Upload and wait for the upload to complete. When it's finished you will see the screen shown in the tutorial.




It's also unclear that you are indeed supposed to copy and paste the first code snippet under "Compile and upload your first MKR1000 Sketch" into your text editor. This is the code you need:


void setup() {
 pinMode(6, OUTPUT);
}
void loop() {
 digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(500);              // wait for 500ms
 digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
 delay(500);              // wait for 500ms
}
To verify your code, click the check mark in the upper left of the editor. I believe this is akin to 'compiling' code in languages such as C. To run the code on your Arduino, click the right-pointing arrow in the upper left-hand corner of the IDE. It is labeled "upload", and the tutorial does not specify that.










After doing so, you will see results in the black text box below the editor, and should get results similar to what I have here:



Here's what happens on the Arduino when this code runs:



I couldn't quite figure out how to verify the WIFI101 version in my IDE as the tutorial shows in Figure 11, but I believe I have the correct version (0.8.0). Since I have 0.8.0 as asked and not 0.7.0, I did not download anything from Github as recommended in that scenario.


I opted not to carry out the instructions for SimpleWebServerWiFi, as I saw no reason that it should pertain to the project I'm trying to complete. I also had no reason to enter the Troubleshooting section.


Overall, this tutorial seems to have given me a solid method to setup my first Arduino, and I feel prepared to begin my real project. I'll perform this project sometime in the coming week, and will document my experience in the next post.

No comments:

Post a Comment