Arduino IDE Friday, 26 October 2018

Similar documents
Outlook Web Access. In the next step, enter your address and password to gain access to your Outlook Web Access account.

Tabbing Between Fields and Control Elements

NCMail: Microsoft Outlook User s Guide

Handout Objectives: a. b. c. d. 3. a. b. c. d. e a. b. 6. a. b. c. d. Overview:

NCMail: Microsoft Outlook User s Guide

iphones for beginners

CheckBook Pro 2 Help

A Document Created By Lisa Diner Table of Contents Western Quebec School Board October, 2007

Lutheran High North Technology The Finder

Computer Basics: Step-by-Step Guide (Session 2)

COPYRIGHTED MATERIAL. Starting Strong with Visual C# 2005 Express Edition

Clearing Your Browser Cache in: Internet Explorer 7 or 8

Guide to Installing Fldigi and Flmsg with Red Cross Templates

Getting Started with Word

Getting Started with Python and the PyCharm IDE

FILE ORGANIZATION. GETTING STARTED PAGE 02 Prerequisites What You Will Learn

Tajima DGML by Pulse Software Version 2009 Setting Up The Software

the NXT-G programming environment

Organizing Screens with Mission Control

vi Primer Adapted from:

CHAPTER 1 COPYRIGHTED MATERIAL. Finding Your Way in the Inventor Interface

Intro To Excel Spreadsheet for use in Introductory Sciences

Lesson 1. Importing and Organizing Footage using Premiere Pro CS3- CS5

A PROGRAM IS A SEQUENCE of instructions that a computer can execute to

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Touch Board User Guide. Introduction

Lesson 1 using Dreamweaver CS3. To get started on your web page select the link below and copy (Save Picture As) the images to your image folder.

Heuristic Evaluation of Covalence

Using Mail Merge in Microsoft Word 2003

USING DRUPAL. Hampshire College Website Editors Guide

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting

The Best Features of Vivaldi, a New Customizable Web Browser for Power Users Friday, April 15, 2016

Computer Concepts for Beginners

Interactive Tourist Map

HYPERSTUDIO TOOLS. THE GRAPHIC TOOL Use this tool to select graphics to edit. SPRAY PAINT CAN Scatter lots of tiny dots with this tool.

Navigating and Managing Files and Folders in Windows XP

All textures produced with Texture Maker. Not Applicable. Beginner.

Ad Muncher's New Interface Layout

Lesson 5: LDR Control

Articulate Engage 2013 Tutorial

I made a 5 minute introductory video screencast. Go ahead and watch it. Copyright(c) 2011 by Steven Shank

Robert Ragan s TOP 3

Term Definition Introduced in: This option, located within the View tab, provides a variety of options to choose when sorting and grouping Arrangement

Clickteam Fusion 2.5 Creating a Debug System - Guide

Slide 1 CS 170 Java Programming 1 Duration: 00:00:49 Advance mode: Auto

Quick Guide. Choose It Maker 2. Overview/Introduction. ChooseIt!Maker2 is a motivating program at first because of the visual and musical

Contents. What's New. Dropbox / OneDrive / Google drive Warning! A couple quick reminders:

Let s begin by naming the first folder you create Pictures.

Azon Master Class. By Ryan Stevenson Guidebook #5 WordPress Usage

SlickEdit Gadgets. SlickEdit Gadgets

Running Wordstar 6 on Windows 7 Using vdos

The first time you open Word

Top 10 Productivity Tips in Fusion 360

Tracking changes in Word 2007 Table of Contents

IN THIS CLASS WE ARE GOING TO LEARN THE BASIC FEATURES OF WINDOWS 8.1 WITH HANDS ON TRAINING THE CLASS WILL RUN ON THE SPEED OF THE AVERAGE STUDENT

Navigate to Success: A Guide to Microsoft Word 2016 For History Majors

Browsing the World Wide Web with Firefox

Microsoft Expression Web Quickstart Guide

Using X-Particles with Team Render

Collector and Dealer Software - CAD 3.1

Copyright 2018 MakeUseOf. All Rights Reserved.

Chrome. Browsing in Chrome. The Omnibox. Video: Browsing in Chrome. To use the Omnibox: Omnibox suggestion icons. Page 1

Rio Hondo Prep Computer Applications Class

Oracle Cloud. Content and Experience Cloud Android Mobile Help E

Summer Assignment for AP Computer Science. Room 302

Dreamweaver Website 1: Managing a Website with Dreamweaver

Required software. Mac OS X In this section, you ll find instructions for downloading and configuring the Arduino IDE in Mac OS X.

How to use IBM/Softlayer Object Storage for Offsite Backup

Box User Guide. Contents

Windows 8.1. Tiles come in four shapes: small, medium, wide, and large. The red outlined tiles are live tiles.

Part 1: Understanding Windows XP Basics

Instructions for Using the Databases

Using Mail Merge in Microsoft Word XP/2002

How To Capture Screen Shots

Creating Vector Shapes Week 2 Assignment 1. Illustrator Defaults

Formatting: Cleaning Up Data

their in the new a program such as Excel or Links aren't just document.

Purchase and Setup instructions for SWVPS (Sept 15, 2014)

TourMaker Reference Manual. Intro

EDGE, MICROSOFT S BROWSER

How To Capture Screen Shots

VBA Excel 2013/2016. VBA Visual Basic for Applications. Learner Guide

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

How to Use Google. Sign in to your Chromebook. Let s get started: The sign-in screen.

COPYRIGHTED MATERIAL. Using Adobe Bridge. Lesson 1

LeakDAS Version 4 The Complete Guide

HTML/CSS Lesson Plans

Regardless of which of these methods is used to create a new design, there are two important pieces of information you ll have to configure.

Adobe Dreamweaver CC 17 Tutorial

USER GUIDE MADCAP FLARE Topics

The first thing we ll need is some numbers. I m going to use the set of times and drug concentration levels in a patient s bloodstream given below.

WORD BASICS: MICROSOFT OFFICE 2010

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

HOW TO USE THE EXPORT FEATURE IN LCL

Electronic Portfolios in the Classroom

How to Edit Your Website

User Help

HCA Tech Note 301: Using the CM15 with HCA and Windows 10

NETWORK THE HOME 10 FOLDERS APPS

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

Transcription:

Arduino IDE Friday, 26 October 2018 12:38 PM Looking Under The Hood Of The Arduino IDE FIND THE ARDUINO IDE DOWNLOAD First, jump on the internet with your favorite browser, and navigate to www.arduino.cc. Look for the tab labeled Download. The page on which you land might look a little different than this. It does change from time to time, but there will always be an obvious tab for Download. Click on that Downloads tab. That will bring you to the Download the Arduino Software page. Once on this page, you have several options. You can download the Windows Installer, or you can download a Windows ZIP file if you are a non-administrator. The third option is to get the absolute latest, razor-sharp release of the Arduino IDE. This is found in the section labeled Hourly Builds. If you want the most recent update, you can download from this section. But this is just as the name implies. The information here can be updated as often as hourly, and may not be as stable as an official public release. Physical Computing and Embedded Sytems Page 1

Therefore, in this lesson, I will demonstrate the Windows Installer. This is the best route to go in almost any case. It s rare that another option is better. DOWNLOAD AND INSTALL When you click on the Windows Installer link, it takes you to a contributions page. It s completely up to you if you want to contribute to the Arduino cause. It is a great idea if you do. However, since this is simply a demonstration, I'm just going to choose download. Next, a popup window opens so that you can direct where to save the ZIP file. It really doesn't matter where you save it. I'm going to save it to my downloads folder. It will then immediately start to download. It s not a big file. It s around 77.7 Megabytes for this current release. I have just an everyday, run of the mill cable internet connection, and yet it still doesn t take very long to download. Once the file is done downloading, double click the executable file. This will open a couple of popup windows. The first one is dependent upon whether or not you already have a older version of Arduino installed. If you already have an older version of Arduino installed, it will ask if you want to first uninstall the older version before continuing the download of the newer version. My recommendation is to select Ok to uninstall the older version. It will not harm anything or delete any work you have done. It simply gets rid of the older Arduino IDE, not your sketch folder. If you don't know what that means, it s not important. Just know that you will not lose anything if you uninstall. Next, it will run through the uninstallation process. Once completed, click Ok. Then, close the uninstall box. Afterwards, agree to the new license, which is just like any other license that basically says you owe Arduino your children. The popup window then asks you to set a few installation options. Just leave all these checked. Physical Computing and Embedded Sytems Page 2

Finally, you select the install location. I personally put it into my programs folder. Once you click Install, it will start extracting. That's really it for the installation. It does take a little longer than you might expect - maybe a minute or two to install the whole package. SET PREFERENCES FOR ARDUINO IDE Once installed, open the Arduino IDE. You can either use the desktop icon or go to your programs folder to use the icon there. We're going to set some Preferences. Go to File and then Preferences. Probably the most important thing to look at is the first line that comes up - the Sketchbook location. Physical Computing and Embedded Sytems Page 3

When we write a program in the Arduino IDE, it's called a sketch. All sketches are saved within a Sketchbook. The Sketchbook is a folder where you can to keep all of your work. The default location is usually under Users\The User s Name \Documents\ and then a folder created that is named Arduino. If yours does not look like this, or if you would prefer the Sketchbook folder be in a different place, you can browse to select a different location. I would definitely recommend using a folder named Arduino. This default location has always worked pretty well for me. The next preference to set is the editor language. You can pick from a bunch of different languages. I'm using English, obviously. Another setting is editor font size. The default is 12, but I prefer a larger font. Font size 18 works very well for me. Be aware that sometimes if you make the font too big, you'll see that one line actually gets written over top of the other. Therefore, you might have to play around with font to find your optimal size. There are a few other things that I think are good to set in preferences. One is whether or not to display the line numbers. I suggest you check the box for this. This means that each line of your program, or sketch, will be displayed on the left side of the Arduino IDE. Another preferences I suggest you choose is to verify the code after upload. This won't mean anything to you now, but you ll see later why this it s an excellent idea to check this feature. The next setting I usually choose is to check for updates on startup. This is not imperative. You can check or uncheck this box depending upon your own personal taste. It depends on whether or not you want to stay with the same current version the whole time. If you just want the most updated version, you can keep that box checked. I do recommend, however, keeping the Update sketch files to new extension checked. Physical Computing and Embedded Sytems Page 4

Basically, this means that whenever you open an Arduino file, it ensure that if the file doesn t have the proper extension, then that file will automatically be converted to.ino. Arduino files used to have a.pde extension. However, now they are.ino files. That s why it s handy to keep this option active. Finally, I think having the last preference chosen is a good idea. That setting is to save the file when you are verifying or uploading. Again, we'll talk about verifying and uploading in depth in later lessons, but just take my word for now that it is always good practice to save as frequently as possible. GOING OLD SCHOOL Not all versions are the same. It could be that maybe you prefer the look and feel of a previous version. Or maybe you re just really familiar with and used to working within the framework of a certain version. If you prefer to download and use a previous version of Arduino, never fear. We have a solution for you that like to go old school. On the Arduino website for downloads, look to the bottom right panel. There is the section for previous releases. Clicking that will show you a list of all previous releases for each type of operating system, along with the date they were released. Click which you prefer, and from there downloading is the exact same process as before. WHICH BOARD AND SERIAL PORT SHOULD I USE? The first thing we're going to discuss is selecting the correct board. We have to let the Integrated Development Environment know what Arduino board you're using. Go to the Tools tab, and then go down to where it says Board. You'll notice I selected the Arduino Uno since that is what I will use throughout the course. Physical Computing and Embedded Sytems Page 5

I recommend that you use an Uno or an Uno derivative throughout the course, as well. This will standardize our work in these lessons. Once you've selected the board, next you need to select your serial port. People can sometimes be intimidated by this technical term, but you don t have to be. Serial ports are just the different things connected to your computer. The easiest way to find out which of the ports listed is your Arduino is to first unplug the Arduino from the computer. Go to the ports list under the Tools tab, and write down the names of these ports. You only need to write enough to differentiate one from the next - maybe the last word or last few letters. Then, close your Arduino IDE. Plug your Arduino board back in via the USB cable to your computer. Open the Arduino IDE. You should now be able to see an additional serial port not on the list you originally wrote down. That will be the serial port to which your Arduino is connected. For Mac, you'll usually see cu or tty after the dev/. Those are the common ways Arduino will show up on the serial port for a Mac. For a PC, it shows up as a COM port, but it's hard to know which one it will be. It could be one, two, four, etc. That s why the best method, although primitive, is just to unplug and plug the Arduino back into that port. Once you ve chosen the board and port the first time, these settings will stay the same for any subsequent times you reopen the Arduino IDE. The reason I point this out is that if you happen to get a different board at some point, you will have to remember to change the board that is selected. THE ARDUINO FILE When you open the Arduino IDE for the first time, it will open up a file for you, giving it a default name. That default is sketch, underscore, and the current date. Physical Computing and Embedded Sytems Page 6

That name also appears at the top of the IDE, along with the version of Arduino you're using. To save this, go to the File tab and then to Save. It's just like saving any other file. Notice it asks you to save the file in Documents. Remember that in Arduino, files are referred to as sketches. So, the collection of our sketches is known as the sketchbook. The sketchbook folder is where all of the sketches we write will be saved. Of course, you can also nest your files in that folder just like you could in any other program where you're saving files. It's really no different. Take a look at the name I chose for my file. There are certain rules you must follow when choosing a name for your sketch. When you're naming a file, you can't use any spaces between the words. One common method is to use an underscore where you would have normally preferred a space. You can't use special characters, either. You can use numbers in the name, but you can't have a number as the first character. Lastly, the names are limited to 64 characters. So, using these rules, name your sketch and save it. Physical Computing and Embedded Sytems Page 7

You'll see that the name on the tab and at the top of the screen now displays the name of your newly saved sketch. So, saving is really easy. The shortcut command is Ctrl S. There is also a down arrow that you can click. THE EDITOR, MESSAGE AREA, AND CONSOLE There are three main areas of the Integrated Development Environment: the editor, the message bar, and the console. The editor is the big white space. It s where you type the Arduino code. It has number lines down the side - as long as that was one of the preferences you checked from our last lesson on choosing your settings. Right now it shows one through nine. If we were to add more code or move our cursor down further, it would adds numbers as lines are added. I want to point out one thing in this name here. Do you see the little funky looking s? Every time you make a change to the sketch that has not been saved, that s will be displayed. If I save the file, it goes away. Physical Computing and Embedded Sytems Page 8

If I were to type something in the sketch again, the funky little s would come back. It s just a visual reminder to save your changes. Personally, I am a save fanatic. For just about every single line of code I write, I use the shortcut key Control S to save before I go on to the next line. I want to make sure I don't lose anything in the event that I have an issue with either the Arduino IDE, my computer, unexpected interruptions, or whatever might happen. There is something interesting you might have noticed when you open a new sketch in Arduino. It auto-populates two of the mandatory functions for coding in Arduino. This is why you see void setup an void loop. We'll talk about these in depth later, but it's perfectly normal for these to show up. It s just a way of helping you save time when you code. On top of the editor area are two very important buttons. The first one is a check mark. It is the Verify button. When you click this, the code gets compiled. Compiling, as discussed before, is taking the human readable code that we've written and translating it into machine code. As it compiles, the program will point out any errors found in that code. It also does some optimization. This is a way behind the scenes concept that you don't have to worry about right now, though. You constantly want to check for errors in your code. I like to verify my code at almost every line of code I write along the way. The more you verify, the more quickly you can identify where you might have introduced an error into the code, i.e. find and fix a bug. We'll be using this verify button all the time. The shortcut key for verify is Command R or Control R. You can also verify by going to the Sketch tab. That other button is the Upload button. That takes all of the code that we've written and uploads it to the Arduino board. When you click that button and look at your Arduino board (assuming that it s hooked up to your computer via the USB cable), you'll see two lights blinking rapidly. That is the TX and RX buttons. Physical Computing and Embedded Sytems Page 9

This is a good visual indicator that you have a good connection between the Arduino board and the computer. The IDE is recognizing that you have a board hooked up. In other words, the lights tell you that the code is successfully being uploaded to the board. The shortcut key to upload is Control U or Command U. It is available in the dropdown under the Sketch tab, as well. The second main area of the IDE is this blue bar. It is the message bar. It will display information about what you've done recently in the program. For example, I just uploaded. You can see that it says, Done Uploading. If I press Control S to save, it would say, Done Saving. There are other pertinent messages that display while you are using the program. The third main area of the IDE is the black space below the message bar. It is called the Console. Physical Computing and Embedded Sytems Page 10

Now, you probably won't hear it referred to as the console very often. Many people just call it the error section, or some other generic term. If you want to increase the console s space, there is a bar you can drag up. It may be hard to see, so I put a box around it. The console displays the error messages. It will tell you information about the current operation that you did. For illustration purposes, let me introduce an error into the code and verify it. I ll just type a crude, uncoded line somewhere in the editor area. You can see that we get definitely get a reaction out of the Arduino IDE. First, the message bar gives us a quick note saying that you wasn t declared. Again, don't worry about understanding the error itself or any of the terminology displayed. I just want you to see where different types of information shows up. Then, in the console much more detailed information about the error is displayed. It tells you what file it was in, what function it was in, Physical Computing and Embedded Sytems Page 11

and even the line of code. Here it says the error was in line three. If we look back up at line three in the editor, we can see that it gets highlighted. That's where we can start looking for our error. Unfortunately, it will not always point out the correct line of code for the error. You might have to do a little searching around, but that is a discussion for another time and another lesson. You now know the three big pieces of the Arduino IDE. We walked through the editor, the message bar, and the console. MISCELLANEOUS TIDBITS There are a few final items we should discuss that are good to know. At the very bottom of the IDE is a number. Currently ours shows the number three. That simply refers to the line of code where your cursor is located. It seems like such a small detail, but it is very handy. Once you begin to work with larger and larger sketches, it may be harder to keep track of your cursor. This is especially true if you decide not to display line numbers down the side. Also, in the far right corner you'll see some additional information. It is the name of the Arduino board and which serial port that you identified earlier that you re using. In the top right, there is a little magnifying glass. This is for the Serial Monitor. Physical Computing and Embedded Sytems Page 12

If you click it, a window like this opens: The Serial Monitor window allows us to see communication occurring between the Arduino and the computer, and vice versa. We'll have an entire lesson later down the road about the Serial Monitor and communications. For now, just know that the button is there. The shortcut key for the Serial Monitor is Shift-Control(or Command)-M. From <https://academy.programmingelectronics.com/arduino-course-for-absolute-beginners-2nd-edition/familiarization-with-the-arduino-hardware-and-software/arduino-ide-familiarization-2/> Physical Computing and Embedded Sytems Page 13