Presentation is loading. Please wait.

Presentation is loading. Please wait.

QSET ELECTRICAL TEAM ARDUINO TUTORIAL I BY: JOSHUA ARDUINI.

Similar presentations


Presentation on theme: "QSET ELECTRICAL TEAM ARDUINO TUTORIAL I BY: JOSHUA ARDUINI."— Presentation transcript:

1 QSET ELECTRICAL TEAM ARDUINO TUTORIAL I BY: JOSHUA ARDUINI

2 WHAT IS ARDUINO Microcontroller Allows for quick prototyping of ideas Accepts both digital and analog signals Simple to use Readily available online support / help / documentation Big part of the QSET Rover

3 DOWNLOADING ARDUINO IDE 1.Go to 2.Select “Download” 3.Download the appropriate version & follow instructions

4 GETTING STARTED Ensure Arduino.exe will open Navigate to Create an account Then select “New Breadboard Circuit”

5 THE BREADBOARD Two sections Connected horizontally labelled by + and – Each row is a separate piece of wire Connected vertically labeled 1 – 60 in this case but can have more or less Each column is a separate piece of wire Pattern repeats after the dotted line. This gap separates the electrical connections

6 BASIC L.E.D. CIRCUIT The arrow marks the direction of current flow. Voltage supply comes directly from the Arduino board (in this example) V = 5 V R = 330 Ω

7 CREATING THE CIRCUIT ON 123D.CIRCUITS DEMO

8 WRITING THE ARDUINO CODE Typically in 3 main parts 1.Initialization of variables 2.Setting up the hardware to recognize components 3.Loop instance that runs indefinitely

9 1. INITIALIZATION OF VARIABLES In this case we only need one variable “int” denotes that it is an integer led was the chosen name for the variable 13 is the pin we are plugging the LED into

10 2. SETTING UP THE HARDWARE TO RECOGNIZE COMPONENTS “Void setup() {“ tells the compiler we are going to start our setup phase of code “pinMode” tells the compiler that we need to do a pin assignment. This instruction has the form: pinMode(PIN#,mode); PIN# - Taken from the #s on the board Mode – Tell the compiler if it is going to be an INPUT or an OUTPUT. “}” denotes the end of the setup function

11 3. LOOP INSTANCE THAT RUNS INDEFINITELY “Void loop() {“ tells the compiler we are going to start our loop phase of code “digitalWrite” tells the compiler that we would like to set a digital value. 1(current) OR 0(no current). This instruction is of the form digitalWrite(PIN#, Value). PIN# - The pin we want to alter Value – Whether we want it to be a HIGH(1) or LOW(0) “delay” tells the compiler to wait for a duration of 1000ms (1 second).

12 3. LOOP INSTANCE THAT RUNS INDEFINITELY CONT. Now we do the “digitalWrite” to tell the LED to turn off and wait 1000ms “}” tells the compiler that this is the end of the instructions that we want to loop Once the program has executed the second delay, it will go up to the beginning of the loop and turn the LED on again

13 NOW EXECUTE ON 123D.CIRUITS DEMO


Download ppt "QSET ELECTRICAL TEAM ARDUINO TUTORIAL I BY: JOSHUA ARDUINI."

Similar presentations


Ads by Google