1 / 16

Arduino Circuits

Arduino Circuits. Getting Started: Building & Programming. What we ’ ll cover. What is Arduino Why we want to use it Arduino Board Anatomy What is an Arduino Sketch? How to Use Arduino IDE software Arduino Foundations - more learning resources. What is Arduino.

Télécharger la présentation

Arduino Circuits

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Arduino Circuits Getting Started: Building & Programming

  2. What we’ll cover What is Arduino Why we want to use it Arduino Board Anatomy What is an Arduino Sketch? How to Use Arduino IDE software Arduino Foundations - more learning resources

  3. What is Arduino Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing.

  4. Why we want to Arduino The Arduino software is easy-to-use for beginners, yet flexible enough for advanced users. It runs on Mac, Windows, and Linux. Teachers and students use it to build low cost scientific instruments, to prove chemistry and physics principles, or to get started with programming and robotics. Designers and architects build interactive prototypes. Musicians and artists use it for installations and to experiment with new musical instruments Makers, of course, use it to build many of the projects exhibited at the Maker Faire. Arduino is a key tool to learn new things.

  5. Arduino Board Anatomy

  6. What is an Arduino Sketch? A sketch is the name that Arduino uses for a program. It's the unit of code that is uploaded to and run on an Arduino board.

  7. Parts of a Sketch: Comments

  8. Parts of a Sketch: Variables A variable is a place for storing a piece of data. It has a name, a type, and a value. The advantage of using a variable is that it's easier to modify the code: you only need to edit the one line that assigns the initial value to the variable. Often, however, the value of a variable will change while the sketch runs. For example, you could store the value read from an input into a variable. Further information on variables can be found here: https://www.arduino.cc/en/Tutorial/Variables

  9. Parts of a Sketch: Functions A function (otherwise known as a procedure or sub-routine) is a named piece of code that can be used from elsewhere in a sketch.

  10. Parts of a Sketch: Functions (cont) There are two special functions that are a part of every Arduino sketch: setup() and loop(). The setup() is called once, when the sketch starts. It's a good place to do setup tasks like setting pin modes or initializing libraries. The loop() function is called over and over and is heart of most sketches. You need to include both functions in your sketch, even if you don't need them for anything.

  11. Using Arduino IDE The Arduino Integrated Development Environment - aka Arduino Software (IDE) contains: • a text editor for writing code • a message area • a text console • a toolbar with buttons for common functions • a series of menus It connects to the Arduino and Genuino hardware to upload programs and communicate with them.

  12. Using Arduino IDE: Writing Sketches Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the text editor and are saved with the file extension .ino. The editor has features for cutting/pasting and for searching/replacing text. The message area gives feedback while saving and exporting and also displays errors. The console displays text output by the Arduino Software (IDE), including complete error messages and other information. The bottom righthand corner of the window displays the configured board and serial port. The toolbar buttons allow you to verify and upload programs, create, open, and save sketches, and open the serial monitor.

  13. Using Arduino IDE: Sketchbook The Arduino Software (IDE) uses the concept of a sketchbook: a standard place to store your programs (or sketches). T he sketches in your sketchbook can be opened from the File > Sketchbook menu or from the Open button on the toolbar. The first time you run the Arduino software, it will automatically create a directory for your sketchbook. You can view or change the location of the sketchbook location from with the Preferences dialog.

  14. Using Arduino IDE: Uploading When you upload a sketch, you're using the Arduino bootloader, a small program that has been loaded onto the microcontroller on your board. It allows you to upload code without using any additional hardware. The bootloader is active for a few seconds when the board resets; then it starts whichever sketch was most recently uploaded to the microcontroller. The bootloader will blink the on-board (pin 13) LED when it starts (i.e. when the board resets).

  15. Arduino Foundations: Learning Resources Getting Started with Arduino Foundations: All you need & more Arduino Language Reference Arduino Playground Arduino Create: Connect, Collaborate, Create

  16. Let’s Review What is Arduino? Give one example of why someone would use arduino Briefly, how does the arduino board work? What is a sketch? Why should you use comments? Why might it be helpful to use “global” variables? What are the two functions all Arduino programs must have? Where are your arduino programs saved? What must you do before uploading your sketch to arduino?

More Related