Presentation is loading. Please wait.

Presentation is loading. Please wait.

Welcome to Digital Electronics using the Arduino Board

Similar presentations


Presentation on theme: "Welcome to Digital Electronics using the Arduino Board"— Presentation transcript:

1 Welcome to Digital Electronics using the Arduino Board

2 What is an Arduino? Arduino is an open-source platform used for building electronic projects. Arduino consists of a programmable circuit board (often referred to as a microcontroller) and a the IDE (Integrated Development Environment) that runs on your computer, used to write and upload computer code to the physical board. The Arduino hardware and software was designed for artists, designers, hobbyists, hackers, newbies, and anyone interested in creating interactive objects or environments. Arduino can interact with buttons, LEDs, motors, speakers, GPS units, cameras, the internet, and even your smart-phone or your TV! This flexibility combined with the fact that the Arduino software is free, the hardware boards are pretty cheap, and both the software and hardware are easy to learn has led to a large community of users who have contributed code and released instructions for a huge variety of Arduino-based projects.

3 What's on the board?

4 Power (USB ) Every Arduino board needs a way to be connected to a power source. The Arduino UNO can be powered from a USB cable coming from your computer or a wall power supply. In the picture on the right the USB connection is labeled (1) The USB connection is also how you will load code onto your Arduino board. That is how we will be connecting the Arduino to the computer.

5 Power LED Indicator Just beneath and to the right of the word “UNO” on your circuit board, there’s a tiny LED next to the word ‘ON’ (11). This LED should light up whenever you plug your Arduino into a power source. If this light doesn’t turn on, there’s a good chance something is wrong. Time to re-check your circuit! There are many other parts on the Arduino that you just don’t need to know right now. So lets get started and have some fun.

6 Let there be blink! Time to start our first project, The Blinking LED. This is what you will need to tackle your first project. An Arduino board, an LED (which stands for light emitting diode), and a computer. LED Can be found in your parts container

7 What is an LED What is a LED? A light-emitting diode (LED) is a two-lead semiconductor light source. It emits light when voltage is applied to the 2 leads. electrons are able to flow and the LED lights up.

8 Lets Build the Circuit Longer leg
Take your Arduino board and place it in front of you the same way it is in the picture. Here we go, Step #1 insert the long leg of the LED (called the Anode) into pin #13 on the Arduino board, put the shorter leg (called the cathode into GND. That stands for ground, we will go over that in a little bit.

9 Hook up the Arduino Board to the Computer
Before we do anything else we need to connect the Arduino board to the computer. Plug the end of the USB cable into the Arduino board. Take the other end of the cable and place it in a USB slot on your computer. You will notice the green power light will come on

10 Open the Software Ok, before we can do anything with the Arduino board, we need to open up the IDE (Integrated Development Environment). This is where we will write the program called a Sketch. To open the software click on the Arduino Icon on the main screen

11 Open the Software When you open up the software it will look like this
This is where we will write the code(program) for the first project.

12 Time to Write the Code Code is what we call the lines of commands you are going to give to the Arduino board. A sketch is what we call the program. So right now we are going to write the lines of code into the software. Don’t worry about understanding what they mean now . We will go over each command at the end.

13 Write the Following Sketch
Write this code into the IDE.

14 Time to Send the Program to the Aduino Board.
You need to press this button To upload your program to the Arduino Board

15 Credit Call me over so I can see that you have completed the circuit because you get credit for each circuit you build correctly.

16 So What Happen The LED on your Arduino board should be blinking? If it isn’t call your teacher over for some help.

17 So How Did This Happen? Lets talk about the program you wrote, line by line. pinMode(13, OUTPUT); This Tells the Arduino board to set pin 13 to OUTPUT or to do something. In this case it was to make the LED Blink. We did this in the setup part of the program because it only needs to be done once during the program. In the loop Section we added these lines of code. digitalWrite(13, HIGH): This tells Arduino to send 5 volts of electricity to the LED (attached to pin 13) and make it light up. Delay(1000) This tells the Arduino board to wait 1000 milliseconds or 1 second before it goes to the next line in the program.

18 So How Did This Happen? digitalWrite(13, LOW); This tells the Arduino board to cut the flow of electricity to pin 13, and this turns the LED off. Delay(1000) We know this makes the Arduino board wait for 1 second. Now because this is in the loop section when the program get to the last line “delay(1000)” it goes right back to the first line in the loop which is to turn the LED back on. This program will run forever because the loop will never stop running. Have some fun and explore using the software, change the delay (1000) to different numbers and see how it effects the program. Remember you need to download the sketch each time you make a change.

19 Review Arduino is an open-source platform used for building electronics projects. The IDE (Integrated Development Environment ) is the software where we type the lines of code to make the Arduino work. A light-emitting diode (LED) is a two-lead semiconductor light source. It emits light when a suitable voltage is applied to the leads. Has 2 legs, the long leg is the Anode which is positive and the shorter leg is called the Cathode and is negative. The Setup part of your program is where you tell Arduino things that just need to be done once. The Loop Section is where we write the lines of code to be repeated over and over again.

20 Review Commands: pinMode (pin #, OUTPUT or INPUT) is how we tell the Arduino board what we want to do. In the blinking light program we told Arduino to set pin #13 to output something. In this case it was the LED lighting up. The pinMode take 2 parameters the first is what pin you want to turn on and the second is whether or not it is an OUTPUT or INPUT(we will talk about that later on). digitalWrite(pin #, HIGH or LOW) This tells Arduino to either send electricity to the pin # or not to. This either turned the LED ON or OFF. delay(number) This tells Arduino to wait for a specific amount of time before going on to the next line of code.


Download ppt "Welcome to Digital Electronics using the Arduino Board"

Similar presentations


Ads by Google