Download presentation
Presentation is loading. Please wait.
1
Introduction to the Arduino
2
DISCLAIMER & USAGE The content of this presentation is for informational purposes only and is intended for students attending Louisiana Tech University only. The authors of this information do not make any claims as to the validity or accuracy of the information or methods presented. Any procedures demonstrated here are potentially dangerous and could result in damage and injury. Louisiana Tech University, its officers, employees, agents and volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation. The Living with the Lab logos should remain attached to each slide, and the work should be attributed to Louisiana Tech University. If you do not agree, then please do not view this content. boosting application-focused learning through student ownership of learning platforms
3
What is an Arduino? Arduinos contain microcontrollers that are programmed to read inputs and perform various tasks. What is a microcontroller? A microcontroller is a small computer. Microcontrollers contain processor cores with memory and are able to be programed for input/output.
4
Arduino 14 Digital Input/Output Pins USB Cable Plug Integrated Circuit
“Brains” of the Arduino External Power Supply Jack Power Pins 6 Analog Input Pins
5
If the Arduino is a computer, why do I need my computer to work with it?
You use your computer to write a program, called a sketch. You upload the sketch to the Arduino. The sketch is processed (or run) on your Arduino, not your computer. Send to Arduino
6
Arduino IDE (Integrated Development Environment)
Contains the components to help you successfully write a sketch. Open New Sketch Upload Save Serial Monitor Menus Tab Control Verify Toolbar Text Editor Serial Monitor (prints out information from the Arduino) Message Area
7
How is the code structured?
Open the example sketch: Blink (File Examples Basics Blink) Header Section – contains information/comments on preceding sketch. It can sometimes contain code. Loop Function – Repeated indefinitely. This section contains code that tells the Arduino what to do. Setup Function – executed only once at the start. Initialize variables, pin modes, and start using libraries in this section.
8
How does the code work? Note: HIGH = 5V LOW = 0V (Always) voltage (V)
time (ms) voltage (V) 0V 5V 1000 ms
9
Lighting an LED Build the circuit on your breadboard.
Use the 5V and ground on your Arduino. 5V 220Ω + - 220Ω 5V same
10
Make LED blink repeatedly blink every half second.
Rebuild the circuit to be powered by pin 8. Open the Arduino IDE. Load the blink sketch (File Examples Basics Blink) Pin number is arbitrary as long as the physical pin matches the pin number written in your sketch. We will adapt this program to control the LED circuit on your breadboard. Pin 8 220Ω 220Ω same V of Pin 8
11
What needs to change? 8 8 8 500 8 500
12
Play around with Arduino. Some ideas:
Change the time to 1.5 seconds on and 1 second off. Change the circuitry to be connected to digital pin 5 and adjust the program accordingly. Blink out SOS in Morse code (dot-dot-dot-dash-dash-dash-dot-dot-dot) three short pulses (0.25 seconds each) followed by . . . three long pulses (0.75 second each) followed by . . . a brief pause (1 second) repeat a through d using an infinite loop
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.