Sunteți pe pagina 1din 54

PragmaticEdu

ARDUINO
ARDUINO TRAINING COURSE

http://www.free-powerpoint-templates-design.com
Course Outline
01 Introductions of Arduino

The Introduction, Spec., Input / Output and Basic Circuit.

02 Digital Output Circuits Using LED

Blinking LED, Running light LED and Delay Coding.

03 Digital Input Circuit Using Button and Sensor

Button on LED, Button on Blinking/running LED and IR Sensor.

04 Play Melody With Buzzer

Play Music With Buzzer and Police Siren.

05 Mobile Robot

Bluetooth Mobile Robot


01

Introductions of Arduino
The Introduction and Spec.
Introduction to Arduino
Hardware and Software
Hardware Software

LED ARDUBLOCK

DC MOTOR

BUTTON

HARDWARE SOFTWARE

IR SENSOR ARDUINO IDE


• Open Source electronic prototyping
What is an platform based on flexible easy to use
hardware and software.
• An open-source hardware platform based
Arduino? on an Atmel AVR 8-bit microcontroller and
a C++ based IDE.
What is an Input / Output ?
Key in or display?

Input is any signal entering an


electrical system / Arduino.
Output is any signal existing an
electrical system.
Switch

Resistor
Basic Circuit
5v
• Are you understand about the
basic of electronic circuits?
LED
light-emitting diode • Are you ready for the next stage
of this course?
Breadboard
• Are you understand about the
breadboard connection?

• Are you ready for the next stage


of this course?
02

Digital Output Circuits


Using LED
Software, Blinking LED, Running light LED and Delay
Coding.
Introduction to Arduino Software
Arduino IDE

Arduino integrated
development
environment (IDE),
which is a cross-
Ardublock is a
platform application
graphical
written in the
programming
programming
language for
language Java.
Arduino.
It originated from the
IDE for the
languages Processing
and Wiring.

Arduino IDE Ardublock


Software Software
How to install Arduino IDE?
Go to https://www.arduino.cc/en/Main/Software

*Install CH340 for Mount IC Arduino


Arduino IDE

Before start Arduino


Programming, all function
of Arduino IDE should be
clear

Arduino Interface

Let’s Start
Practical1:Blinking LED
Application of blinking LED such as car signal, light house, alarm
lamp and indicator lamp
Let Do Practical

HIGH and LOW?


/ Project 1 - LED Fl

asher

/ int ledPin = 10;


void setup() {
pinMode(ledPin, OUTPUT);
}

void loop() {
digitalWrite(ledPin, HIGH);


delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}

The Basic of Blinking LED


Coding Explanation
How To Set Up Blinking LED

void setup() {
port #

pinMode(9, OUTPUT);
Input or Output
}
Coding Explanations
How To Set Up Blinking LED

void loop() { Port # from setup

digitalWrite(9, HIGH);
delay(1000);
digitalWrite(9, LOW);
delay(1000);
Turn the LED on
or off
} Wait for 1 second
or 1000 milliseconds
Let Do It Step by Step
Blinking LED

Step 1 Step 2 Step 3

Upload Your Code

Wiring Open IDE Software send a code to


Goto Arduino
Follow the example File>Example>01.Basic>Blink
circuits, R=220  and Connect Arduino to USB
port>Goto Tool and Select Port
Circuit Real
Exercise :
1.Try to Blink
Fastly or Slowly

2.Try to Blink
3 LED with
Different Color
Practical 2:
Running LED
Let Do It Step by StepRunning LED

Step 1 Step 2 Step 3


void setup() {
// initialize the LED pin as an output:
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);

void loop(){

digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)


delay(200); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LO
W
delay(200); // wait for a second
digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(12, LOW); // turn the LED off by making the voltage LO
W
delay(200); // wait for a second
digitalWrite(11, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(11, LOW); // turn the LED off by making the voltage LO Upload Your Code
W
delay(200);
}
send a code to
Wiring Arduino
Follow the example Open IDE Software
circuits, R=220  Study This Code and Understand It
Circuit Real
Exercise :
1.Try to Running
Fastly or Slowly

2.Try to Running
And Blink
03

Digital Input Circuit Using


Button and Sensor
Button on LED, Button on Blinking/running LED and IR
Sensor.
Practical 3:
Input Button
Coding Explanation
Button Input
// constants won't change. They're used here to set pin
numbers:
const int buttonPin = 2; // the number of the pushbutt
on pin
const int ledPin = 13; // the number of the LED pin

// variables will change:


int buttonState = 0; // variable for reading the push
button status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
Coding Explanations
Button Input

void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed. If it is, the


buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
Let Do It Step by Step
Input Button LED

Step 1 Step 2 Step 3

Upload Your Code


send a code to
Wiring Open IDE Software Arduino
Follow the example
circuits ,RLED=220 Goto
R input 10K File>Example>0.2.Digtal>Buttonk
and Connect Arduino to USB
port>Goto Tool and Select Port
Circuit Real
Exercise :
If Button
Press=Running
If Button
Release=Blinking
Practical 4:
IR sensor
Let Do It Step by Step
IR sensor

Step 1 Step 2 Step 3

Upload Your Code


Wiring send a code to
Follow the example Open IDE Software Arduino
circuits ,RLED=220 Previous Coding
Circuit Real
Exercise :
1.Try to replace
sensor with IR
flame Sensor
2.If have a fire, 3
LED Blink, else
All LED Off
04

Play Melody With Buzzer


Play Music With Buzzer and Police Siren.
Welcome!!
Lets Learn How to Make a Song with Arduino

Mario, Iman Mutiara, Gong xi-


Gong xi and Police Siren
Coding Explanation
Tone

Syntax
tone(pin, frequency)
tone(pin, frequency, duration)

Parameters
pin: the pin on which to generate the tone
frequency: the frequency of the tone in hertz - unsigned int
duration: the duration of the tone in milliseconds (optional) - unsigned long
Practical 4:
Play Music With
Buzzer
Let Do It Step by Step
Play Music With Buzzer

Step 1 Step 2 Step 3

Upload Your Code


Wiring send a code to
Follow the example Open IDE Software Arduino
circuits ,RLED=220 Copy at Melody File
Exercise :
1.Try to do some
system with IR
flame Sensor and
Buzzer
Practical 5:
Police Siren
Let Do It Step by Step
Police Siren

Step 1 Step 2 Step 3

Upload Your Code


Wiring send a code to
Follow the example Open IDE Software Arduino
circuits ,RLED=220 Copy at Police Siren File
Circuit Real
Exercise :
1.Try to do some
system with IR
Sensor, Buzzer
and 5 LED
05

Mobile Robot
Bluetooth Mobile Robot
Mobile Robot
Robot Car
Practical 6:
Mobile Robot
Let Do It Step by Step
Mobile Robot

Step 1 Step 2 Step 3

Upload Your Code


Play the video send a code to
Open IDE Software Arduino
Follow the instruction
Copy at mobile car File
Circuit
Circuit Real
Practical 7:
Mobile Robot with
Bluetooth
Let Do It Step by Step
Bletooth

Step 1 Step 2 Step 3

Upload Your Code


Wiring send a code to
Connect Bluetooth
Open IDE Software Arduino
with Arduino and
previous wiring Copy at Bluetooth File
Let Do It Step by Step
Bletooth

Step 4 Step 2 Step 3

Play
Wiring Mobile Robot With
Connect HP to Bluetooth Arduino
Install on smartphone Find Bluetooth name same with
setting
Real
Thank you
PragmaticEdu Hope U Enjoy This Training

S-ar putea să vă placă și