Presentation is loading. Please wait.

Presentation is loading. Please wait.

Electrical team Arduino tutorial I BY: JOSHUA arduini

Similar presentations


Presentation on theme: "Electrical team Arduino tutorial I BY: JOSHUA arduini"— Presentation transcript:

1 Electrical team Arduino tutorial I BY: JOSHUA arduini
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
Go to Select “Download” 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 Initialization of variables Setting up the hardware to recognize components 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 "Electrical team Arduino tutorial I BY: JOSHUA arduini"

Similar presentations


Ads by Google